这一节是w3school导航条练习。
我就不多说了,直接放代码,代码我没给注释,自己一段一段写看看每段代码的作用。
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>导航条</title>
<link rel="stylesheet" href="../exercise/css/reset.css">
<style>
.nav{
width:1210px;
height:48px;
background-color:#e8e7e3 ;
margin:100px auto;
}
.nav li{
height: 48px;
line-height: 48px;
float: left;
}
.nav a{
display: block;
text-decoration: none;
color:#777777;
padding: 0 39px;
font-size: 18px;
}
.nav li:last-child a{
padding: 0 42px 0 41px;
}
li :hover{
background-color: #3F3F3F;
color: #E8E7E3;
}
</style>
</head>
<body>
<ul class="nav">
<li>
<a href="#">HTML/CSS</a>
</li>
<li>
<a href="#">Browser Side</a>
</li>
<li>
<a href="#">Server Side</a>
</li>
<li>
<a href="#">Programming</a>
</li>
<li>
<a href="#">XML</a>
</li>
<li>
<a href="#">Web Building</a>
</li>
<li>
<a href="#">Reference</a>
</li>
</ul>
</body>
</html>