<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>导航条练习</title>
<link rel="stylesheet" href="reset.css">
<style type="text/css">
.nav{
width: 1175px;
height: 48px;
background-color: #e8e7e3;
margin: 100px auto;
}
.nav li{
float: left;
/*字体居中*/
line-height: 48px;
}
.nav a{
display: block;
text-decoration: none;
color: #777;
font-size: 18px;
padding: 0 39px;
}
.nav li:hover{
background-color: #3f3f3f;
color: #e8e7e3;
}
.nav li:last-child a{
padding: 0 42px 0 45px;
}
</style>
</head>
<body>
<ul class="nav">
<li>
<a href="#">HTML/CSS</a>
</li>
<li>
<a href="#">Browser Side</a>
</li>
<li>
<a href="#">Sever 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>
效果: