1、效果图:
新浪导航.png
2、代码
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>新浪导航</title>
<style>
.nav {
width: 100%;
height: 45px;
background-color: #fcfcfc;
line-height: 45px;
border-top: 3px solid #ff8500;
border-bottom: 1px solid #eeeeee;
}
.nav a {
/* a属于行内元素 此时必须要转换 行内块元素 */
display: inline-block;
text-decoration: none;
color: #4c4c4c;
font-size: 14px;
padding: 0px 20px;
height: 45px;
}
.nav a:hover {
color: #ff8500;
background-color: #eeeeee;
}
</style>
</head>
<body>
<div class="nav">
<a href="#">新浪导航</a>
<a href="#">手机新浪网</a>
<a href="#">移动客户端</a>
<a href="#">微博</a>
<a href="#">一点通</a>
</div>
</body>
</html>
网友评论