abstract:<!DOCTYPE html><html><head> <meta charset="utf-8"> <title>导航布局实战</title> <style type="text/css"> *{margin: 0px;padding: 0px;} a{text-dec
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>导航布局实战</title>
<style type="text/css">
*{margin: 0px;padding: 0px;}
a{text-decoration: none;color: #000;font-size: 13px;}
li{list-style: none;}
.clear{clear: both;}
#box{width: 100%;background-color: #F5F5F5;}
#box1{width: 1200px;margin: 0 auto;line-height: 40px;}
#box1 a:hover{color: #FF5000;}
.left{height: 40px;float: left;}
.left a{margin-right: 5px;}
.right{height: 40px;float: right;}
.right a{margin-right: 5px;}
.a{display: inline-block;height: 40px;width: 90px;text-align: center;position: r}
.a:hover{background-color: #FFF;}
.a ul{border: 1px solid #F5F5F5;display: none;border-top: none;}
.a:hover ul{display: block;position: absolute;}
.a ul li{color: #6c6c6c;height: 40px;line-height: 40px;text-align: left;width: 78px;padding: 0px 6px;}
.a ul li:hover{background-color: #F5F5F5;}
</style>
</head>
<body>
<div id="box">
<div id="box1">
<div class="left">
<a href="" class="a">中国大陆</a>
<a href="" style="color: #FF5000">亲,请登录</a>
<a href="">免费注册</a>
<a href="">手机逛淘宝</a>
</div>
<div class="right">
<a href="" class="a">我的淘宝
<ul>
<li>我买到的宝贝</li>
<li>我的足迹</li>
</ul>
</a>
<a href="">购物车</a>
<a href="" class="a">收藏夹</a>
<a href="">商品分类</a>
<a href="" class="a">卖家中心</a>
<a href="" class="a">联系客服</a>
<a href="" class="a">网站导航</a>
</div>
</div>
<div class="clear"></div>
</div>
</body>
</html>
Correcting teacher:天蓬老师Correction time:2019-06-05 13:10:50
Teacher's summary:清浮动可以有更好的方式:
<div class="clear"></div>, 不要用这种... 可以用伪类来做: after