<!DOCTYPE html> <html> <head> <meta charset="uft-8"> <title>导航条案例-淘宝网</title> <link rel="stylesheet" type="text/css" href="css/index1.css"> <link rel="stylesheet" type="text/css" href="css/font-awesome-4.7.0/css/font-awesome.min.css"> </head> <body> <div> <div> <div> <a href="" style="color:#000;">中国大陆 <i class="fa fa-angle-down"></i></a> <a href="" style="color:#F22E00;">亲,请登陆</a> <a href="">免费注册</a> <a href="">手机逛淘宝</a> </div> <div> <a href=""> 我的淘宝 <i class="fa fa-angle-down"></i></a> <a href=""><span class="fa fa-shopping-cart" style="color:#FF4400;"> </span>购物车 <i class="fa fa-angle-down"></i></a> <a href=""><span class="fa fa-star"> </span>收藏夹 <i class="fa fa-angle-down"></i></a> <a href="">商品分类</a> <a href="">卖家中心 <i class="fa fa-angle-down"></i></a> <a href="">联系客服 <i class="fa fa-angle-down"></i></a> <a href="" ><span class="fa fa-bars" style="color:#FF4400;"> </span>网站导航 <i class="fa fa-angle-down"></i></a> </div> <div></div> </div> </body> </html>
*{margin: 0px;padding: 0px;} a{text-decoration: none;color: #6C6C6C;font-size: 13px;} .clear{clear: both;} .header{width: 100%;background-color:#F5F5F5;} .header_content{width:1200px;margin:0px auto;line-height: 40px;} .header_left{height: 40px;float: left;} .header_left a{margin-right:5px; } .header_content a:hover{color:#F22E00;} .header_right{height: 40px;float: right;} .header_a{display: inline-block; width:90px;height: 40px;text-align: center;} .header_a:hover{background-color: #fff;}
总结:
字体库的引用
块级元素和行内元素的转化
display的正确运用