css
ul {
list-style-type: none;
margin: 0px;
padding: 0px;
width: 400px;
height: 30px;
background-color: blue;
}
a:link,a:visited{
text-decoration: none;
background-color: red;
text-align: center;
width: 50px;
color: aliceblue;
}
a{
line-height: 30px;
}
a:active,a:hover{
background-color: crimson;
}
li{
display: inline;
padding-left: 14px;
}
html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<link rel="stylesheet" type="text/css" href="test.css">
</head>
<body>
<ul>
<li><a href="">导航栏1</a></li>
<li><a href="">导航栏2</a></li>
<li><a href="">导航栏3</a></li>
<li><a href="">导航栏4</a></li>
<li><a href="">导航栏5</a></li>
</ul>
</body>
</html>