<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<style type="text/css">
*{
margin: 0;
padding: 0;
}
ul{
width: 960px;
height: 40px;
background-color: green;
margin: 100px auto;
}
ul li{
list-style: none;
width: 120px;
height: 40px;
float: left;
background-color: purple;
text-align: center;
line-height: 40px;
}
ul li a{
width: 120px;
height: 40px;
display: inline-block;
}
ul li a:link{
background-color: pink;
color: white;
text-decoration: none;
}
ul li a:hover{
color: red;
background-color: #ccc;
}
ul li a:active{
color: yellow;
}
</style>
</head>
<body>
<ul>
<li><a href="#">我是导航</a></li>
<li><a href="#">我是导航</a></li>
<li><a href="#">我是导航</a></li>
<li><a href="#">我是导航</a></li>
<li><a href="#">我是导航</a></li>
<li><a href="#">我是导航</a></li>
<li><a href="#">我是导航</a></li>
<li><a href="#">我是导航</a></li>
</ul>
</body>
</html>