css 灰色导航菜单
实例代码:
<!doctype html>
<html>
<meta charset="utf-8">
<head>
</head>
<style>
ul{
background-color:#f3f3f3;
list-style-type:none;
overflow:hidden;
padding:0;
margin:0;
}
.home{
color:white;
background-color:#4CAF50;
}
li a {
padding:14px 16px;
text-decoration:none;
text-align:center;
color:#666;
display:block;
float:left;
}
li a:hover:not(.home){
background-color:#ddd;
}
</style>
<body>
<ul>
<li><a class="home" href="https://www.dwoke.com">Home</a></li>
<li><a href="https://www.dwoke.com">News</a></li>
<li><a href="https://www.dwoke.com">Contact</a></li>
<li><a href="https://www.dwoke.com">About</a></li>
</ul>
</body>
</html>
运行效果:
评论