abstract:<!DOCTYPE html><html><head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<link rel="stylesheet" type="text/css" href="style.css">
<link rel="stylesheet" type="text/css" href="font-awesome-4.7.0\css\font-awesome.min.css">
<title>我的作业</title>
<!-- <style media="screen">
li{list-style: none;}
</style> -->
</head>
<body>
<div>
<div>
<div>
<a href=""class="header_a">中国大陆 <i class="fa fa-angle-down"></i></a>
<a href="" style="color:#F22E00" >亲,请登录</a>
<a href="">免费注册</a>
<a href="">手机逛淘宝</a>
</div>
<div>
<a href=""class="header_a">我的淘宝 <i class="fa fa-angle-down"></i>
<ul>
<li>已买到的宝贝</li>
<li>我的足迹</li>
</ul>
</a>
<a href=""class="header_a"> <span class="fa fa-shopping-cart"style="color:#F22E00"></span> 购物车 <i class="fa fa-angle-down"></i></a>
<a href=""class="header_a"><span class="fa fa-star"</span> 收藏夹 <i class="fa fa-angle-down"></i>
<ul>
<li>收藏的宝贝</li>
<li>收藏的店铺</li>
</ul>
</a>
<a href="">商品分类</a>
<a href=""class="header_a">| 卖家中心 <i class="fa fa-angle-down"></i>
<ul>
<li>免费开店</li>
<li>卖出的宝贝</li>
<li>出售中的宝贝</li>
<li>卖家服务市场</li>
<li>卖家培训中心</li>
<li>体验中心</li>
<li>问商友</li>
</ul>
</a>
<a href=""class="header_a">联系客服 <i class="fa fa-angle-down"></i>
<ul>
<li>消费者客服</li>
<li>卖家客服</li>
</ul>
</a>
<a href=""class="header_a"><span class="fa fa-bars"style="color:#F22E00"></span> 网站导航 <i class="fa fa-angle-down"></i></a>
</div>
<div></div>
</div>
</div>
</body>
</html>
/* 去除默认样式 */
*{margin: 0px;padding: 0px;}
/* 设置a标签的样式 */
a{text-decoration: none;font-size: 10px;color: #3C3C3C;}
/* 设置li标签格式去除标签头 */
li{list-style: none;}
/* 清除浮动 */
.clear{clear: both;}
/* 设置导航条底色 */
.header{width: 100%;background-color: #F5F5F5;}
/* 设置容器居中div */
.header_center{width:1200px;margin: 0px auto;line-height: 40px;}
/* 设置左边文字div */
.header_left{height: 40px;float: left;}
/* 设置右边文字div */
.header_right{height: 40px;float: right;}
/* 设置导航条div中a标签属性 */
.header_center a{display: inline-block;margin-right: 3px;text-align: center;line-height: 40px;width: 80px;height: 40px;position: relative;}
/* 设置a标签鼠标事件 */
.header_center a:hover{color: #F22E00;background-color: #fff;}
/* 设置ul标签的属性 */
ul{border: 1px solid #F5F5F5;border-top:none;display: none;}
/* 设置下拉列表触发事件 */
.header_a:hover ul{display: block;position: absolute;}
/* 设置li标签属性 */
.header_a ul li{color: #3C3C3C;height: 30px;line-height: 30px;text-align: left;width: 85px;padding: 0px 0px 0px 5px;margin: 5px 0px;}
/* 这是li标签触发事件 */
.header_a ul li:hover{background-color: #F5F5F5;}
通过不断练习,发现自己掌握不足的知识点,并加以练习,输入有时会出现错误,再就是对定位认识比较差
Correcting teacher:西门大官人Correction time:2019-02-24 09:58:46
Teacher's summary:效果基本实现了,但是菜单没有跟随 都在最左侧显示,多看看定位和浮动的知识