<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
<link rel="stylesheet" href="../static/font/css/font-awesome.css">
</head>
<style>
*{
margin: 0;
padding: 0;
}
a{
text-decoration: none;
color: #6c6c6c;
font-size: 13px;
text-align: center;
}
li{
list-style: none;
}
.clear{clear: both}
#header{
width: 100%;
background-color: #f5f5f5;
}
.header_content{
width: 1200px;
background-color: red;
margin: 0 auto;
line-height: 40px;
}
.header_content a:hover{
color: #FF5000;
}
.header__left{
height: 40px;
float: left;
}
.header__left a{
margin-left: 5px;
}
.header_right{
height: 40px;
float: right;
}
.header_right a{
margin-left: 5px;
}
.header_a{
display: inline-block;
width: 90px;
height: 40px;
text-align: center;
}
.header_a ul{
border: 1px solid #F5F5F5;
border-top: none;
display: none;
}
.header_a ul li{
color: #6c6c6c;
text-align: left;
}
.header_a:hover ul{
display: block;
position: absolute;
}
.header_a ul li:hover{
background-color: red;
}
.header_a:hover{
background-color: #fff;
}
</style>
<body>
<div id="header">
<div class="header_content">
<div class="header__left">
<a href="" class="header_a">中国大陆 <i class="fa fa-angle-down"></i></a>
<a href="" style="color: #FF5000; ">亲,请登录</a>
<a href="">免费注册</a>
<a href="">手机逛淘宝</a>
</div>
<div class="header_right">
<a href="" class="header_a">我的淘宝 <i class="fa fa-angle-down"></i>
<ul>
<li>已买到的宝贝</li>
<li>我的足迹</li>
</ul>
</a>
<a href=""><span class="fa fa-cart-plus" style="color: #FF5000; "></span> 购物车</a>
<a href="">收藏夹 <i class="fa fa-angle-down"></i></a>
<a href=""><span class="fa fa-star"></span> 商品分类</a>
<a href="" class="header_a">卖家中心 <i class="fa fa-angle-down"></i></a>
<a href="" class="header_a">联系客服 <i class="fa fa-angle-down"></i></a>
<a href="" class="header_a"><span class="fa fa-align-justify" style="color: #FF5000; "></span> 网站导航 <i class="fa fa-angle-down"></i></a>
</div>
</div>
<div class="clear"></div>
</div>
</body>
</html>
不知道为什么hover指定标签的时候可以用指定class就不能用了