老师我不太懂那个active?,前面写一个active,后面就可以了,不太理解nav那块部分?
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
<style type="text/css">
*{
padding: 0;
margin: 0;
color: white;
}
a{
text-decoration:none;
}
header{
height:80px;
background: black;
}
header >.container{
width: 1200px;
margin: 0 auto;
}
header >.container > a{
display: block;
float: left;
margin:20px 25px;
height: 40px;
font-size: 25px;
}
header >.container > a > img{
height: 40px;
width: 40px;
margin-right: 10px;
}
header >.container > nav{
float: right;
line-height: 80px;
height: 80px;
margin-right: 50px;
}
header >.container > nav >a{
font-size: 24px;
display: block;
float: left;
width: 110px;
height:73px;
text-align: center;
}
nav > a.Home{background:red ;}
.Course{background:#ffcc00;}
.Actual{background:green;}
.Plan{background:#0000ff;}
.FAQ{background:orange;}
.Notes{background: #70db93;}
下面这个不太懂, activ不是只代表第一个吗?类名
nav > a:hover,nav > a .active{
padding-bottom: 7px;
}
</style>
</head>
<body>
<header>
<div class="container">
<a href="#"><img src="http://img1.sycdn.imooc.com/climg//582e5f160001b17100400040.png" />MYMOOC</a>
<!-- <span></span> -->
<nav>
<a href="#" class="Home active">Home</a>
<a href="#" class="Course">Course</a>
<a href="#" class="Actual">Actual</a>
<a href="#" class="Plan">Plan</a>
<a href="#" class="FAQ">FAQ</a>
<a href="#" class="Notes">Notes</a>
</nav>
</div>
</header>
</body>
</html>
恭喜解决一个难题,获得1积分~
来为老师/同学的回答评分吧
0 星