效果图
。
。
。
。
css
* {
margin: 0;
padding: 0;
}
li {
list-style: none;
}
a {
text-decoration: none;
}
.w {
width: 1200px;
margin: auto;
}
body {
background-color: #f3f5f7;
}
.clearfix:after {
content: "";
display: block;
height: 0;
clear: both;
visibility: hidden;
}
.clearfix {
*zoom: 1;
}
/* header部分 */
.header {
height: 42px;
/* background-color: pink; */
margin: 30px auto;
}
.logo {
float: left;
width: 198px;
height: 42px;
background-color: plum;
}
.nav {
float: left;
margin-left: 60px;
}
.nav ul li {
float: left;
margin: 0 15px;
}
.nav ul li a {
display: block;
height: 42px;
padding: 0 10px;
line-height: 42px;
font-size: 18px;
color: #050505;
}
.nav ul li a:hover {
border-bottom: 2px solid rgb(33, 128, 218);
color: rgb(33, 128, 218);
}
.search {
float: left;
height: 42px;
width: 405px;
background-color: skyblue;
margin-left: 50px;
}
.search input {
float: left;
width: 345px;
height: 40px;
border: 1px solid rgb(33, 128, 218);
border-right: none;
color: #bfbfbf;
font-size: 14px;
padding-left: 15px;
}
.search button {
float: left;
width: 40px;
height: 40px;
background-color: rgb(33, 128, 218);
border: 0;
background: url(images/search\ button.png) no-repeat top center;
}
.user {
float: right;
line-height: 42px;
margin-right: 30px;
font-size: 14px;
color: #666;
}
/* banner部分 */
.banner {
height: 421px;
background-color: #1c036c;
}
.banner .w {
height: 421px;
background-color: rgb(118, 120, 243);
}
.subnav {
float: left;
width: 190px;
height: 421px;
background: rgba(0, 0, 0, 0.3)
}
.subnav ul li {
height: 45px;
line-height: 45px;
padding: 0 20px;
}
.subnav ul li a:hover {
color: rgb(33, 128, 218);
}
.subnav ul li a {
font-size: 14px;
color: #fff;
}
.subnav ul li a span {
float: right;
}
.course {
/* position: sticky;
top: 5px; */
float: right;
width: 230px;
height: 300px;
background-color: #fff;
margin-top: 50px;
}
.course h2 {
height: 48px;
background-color: #9bceea;
text-align: center;
line-height: 48px;
font-size: 18px;
color: #fff;
}
.bd {
padding: 0 20px;
}
.bd ul li {
padding: 14px 0;
border-bottom: 1px solid #ccc;
background-color: #fff;
}
.bd ul li h4 {
font-size: 16px;
color: #4e4e4e;
}
.bd ul li p {
font-size: 12px;
color: #a5a5a5;
}
.bd .more {