水平导航栏实例
实例代码:
<html>
<head>
<meta charset="utf-8">
<style>
ul{
list-style-type:none;
margin:0;
padding:0;
overflow:hidden;
background-color:#333;
width:600px;
}
li{
float:left;
}
li a {
display:block;
color:white;
padding:15px;
text-decoration:none;
}
li a:hover{
background-color:#111;
}
</style>
</head>
<body>
<h1>水平导航栏实例</h1>
<ul>
<li><a href="www.dwoke.com">Home</a></li>
<li><a href="www.dwoke.com">News</a></li>
<li><a href="www.dwoke.com">Contact</a></li>
<li><a href="www.dwoke.com">About</a></li>
</ul>
<p>注:移动鼠标到链接会改变背景颜色。</p>
</body>
</html>
运行效果:
评论