<!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>新浪weibo-导航栏-盒子模型初级练习</title>
<style>
/* 案例核心
·字数不同,盒子大小不同,无法设置盒子固定大小
·内边距相同
·利用内边距padding撑开盒子
·<a>行转行内块inline-block,一行多个,有宽、高
·text-align:水平居中
line-height:垂直居中(h=盒子h)
*/
.nav {
background-color: #fcfcfc;
border-top: 3px solid #ff8500;
border-bottom: 1px solid #edeef0;
height: 41px;
}
.nav a {
text-decoration: none;
color: #4c4c4c;
display: inline-block;
padding: 0px 20px;
line-height: 41px;
}
.nav a:hover {
background-color: #eee;
color: #ff8500;
}
</style>
</head>
<body>
<div class="nav">
<a href="#">设为首页</a>
<a href="#">手机新浪网</a>
<a href="#">移动客户端</a>
<a href="#">博客</a>
<a href="#">微博</a>
<a href="#">关注我</a>
</div>
</body>
</html>