模仿淘宝首页导航条基本样式布局

Original 2019-01-18 14:46:30 190
abstract:<!DOCTYPE html><html><head><meta charset="UTF-8"><title>布局演练</title><link rel="stylesheet" type="text/css" href="8.css"&g

<!DOCTYPE html>

<html>

<head>

<meta charset="UTF-8">

<title>布局演练</title>

<link rel="stylesheet" type="text/css" href="8.css">

<link rel="stylesheet" href="font-awesome-4.7.0/css/font-awesome.min.css">

<!--http://fontawesome.dashgame.com/-->

</head>

<body>

<div>

<div>

<div>

<a href="#">中国大陆&nbsp;<i class="fa fa-angle-down"></i></a>

<a href="#" style="color: #ff5723;">亲,请登录</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-cart-plus" style="color:#ff5723;"></span> 购物车<span style="color: #ff5723;font-weight: bold;">0</span></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="#">网站导航 <i class="fa fa-angle-down"></i></a>

</div>

</div>

<div></div>

</div>

</body>

</html>


CSS样式如下:

*{margin: 0px;padding: 0px;}/* 清除浏览器默认的和margin和padding边距属性*/

.header{width: 100%; height: 40px; background-color: #f5f5f5;font-size: 12px;}

.header_content{width: 1200px;height: 40px;margin: 0px auto;line-height: 40px;}

.header_content a{color: #9c9c9c;}

.header_content a:hover{color: #ff5000;}

.header_left{height: 40px;float: left;}

.header_left a{margin-left: 5px;}

.header_right{width: 600px;height: 40px;float: right;}

.clear{clear:both;}/*清除float浮动*/

a{text-decoration: none;color: #000;}

.header_a{display: inline-block;height: 40px;width: 90px;text-align: center;}

.header_a:hover{background-color: #fff;}

Correcting teacher:灭绝师太Correction time:2019-01-18 14:54:47
Teacher's summary:完成的不错,布局中有字体和图片老师看不到你的具体效果,下次作业附带上作业完成图片哟!

Release Notes

Popular Entries