导航栏是一个链接列表,经过css样式调整之后得来。
<html>
<head>
<style>
ul {
list-style-type: none;
margin: 0px;
padding: 0px;
overflow: hidden;
background-color: black;
}
li {
float: left;
}
a:link,
a:visited {
display: block;
text-align: center;
padding: 14px 16px;
text-decoration: none;
color: white;
}
a:hover {
background-color: lightgray;
}
</style>
</head>
<body>
<ul>
<li><a href="">主页</a></li>
<li><a href="">新闻</a></li>
<li><a href="">联系</a></li>
<li style="float:right;"><a href="">关于</a></li>
</ul>
</body>
</html>