首页 > 技术文章 > 项目/头部与底部

ltc123 2021-10-29 19:40 原文

头部:

html部分:

 

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
<link rel="stylesheet" type="text/css" href="css/toubu.css"/>
</head>
<body>
<div class="head">
<!-- div.line$*3-->
<div class="line1">
<span class="log">
<img src="img/logo/yinLogo.png" >
</span>
<!-- ul>(li>a[href=#]{购物须知})*3-->
<ul>
<li><a href="#">官方微博</a></li>
<li><a href="#">关注微信</a></li>
<li><a href="gouwuxuzhi.html" target="_top">购物须知</a></li>
</ul>
</div>
<div class="line2">
<!-- span.log+span.search+ul>li*3-->
<span class="log">
<img src="img/logo/shop-logo-v1.png" >
</span>
<div>
<input type=text"" class="search" />
<span class="btn"></span>
</div>

<ul>
<li><img class="login" src="img/icon/avatar.png" ><a href="login.html">登录</a></li>
<li><a href="#">我的订单</a></li>
<li><img class="cart" src="img/icon/cart-logo-v1.png" ><a href="#">购物车</a></li>
</ul>
</div>
<hr />
<div class="line3">
<!-- span.title+ul>(li>a[href=#]{明星周边})*8-->
<span class="title"><a href="#">艺人分类</a></span>
<ul>
<li><a class="active" href="shouye.html" target="_top">首页</a></li>
<li><a href="liebiao.html" target="_top">专辑</a></li>
<li><a href="#">明星周边</a></li>
<li><a href="#">明星同款</a></li>
<li><a href="#">个护美妆</a></li>
<li><a href="#">影漫周边</a></li>
<li><a href="#">食品</a></li>
<li><a href="#">服装配饰</a></li>
</ul>
</div>
</div>
</body>
</html>

css部分:

body{
margin: 0 auto;
}

.head{
background-color: #222;
}


.head ul{
padding-left: 0;
}

.head ul li{
display: inline-block;
}

.head a{
text-decoration: none;
color: white;
display: block;
}

.head .line1{
background-color: #000;
display: flex;
justify-content: space-between;
align-items: center;
}
.head .line1 .log{
margin-left: 120px;
}

.head .line1 ul{
margin-right: 120px;
}

.head .line1 li{
width: 120px;
border-right: 1px solid #999;
text-align: center;
}

.head .line1 li:last-child{
border: none;
}
.head .line2{
width: 1000px;
margin: 0 auto;
display: flex;
justify-content: space-between;
align-items: center;
}

.head .line2 div{
position: relative;
}

.head .line2 .search{
display: inline-block;/*显示在一行*/
/*background-color: white;*/
width:435px;
height: 40px;
border: none;
background: url(../img/icon/search_icon.png);
background-position: 0 -43px;
/*text-align: right;*/
outline: none;
color: white;
font-size: 16px;
padding-left: 16px;
}
.head .line2 .btn{
display: inline-block;
width: 32px;
height: 40px;
position: absolute;
background: url(../img/icon/search_icon.png);
background-position: -456px 0px;
right: 10px;
}

.head .line2 .search:focus{
background-position: 0 1px;
color: #333333;
}

.head .line2 .search:focus + .btn{
background-position: -456px -43px;
}

.head .line2 li{
margin: 0 15px;
}
.head .line2 li a{
display: inline-block;
}

.head .line2 li img{
display: inline-block;
height: 20px;
width: 20px;
vertical-align: middle;
margin-right: 10px;
}

.head hr{/*两个边框决定 先去边框 再修改*/
border: none;
border-bottom: 1px solid #999;
margin-bottom: 0;
}

.head .line3{
width: 1000px;
margin: 0 auto;
display: flex;
justify-content: space-between;
align-items: center;
}

.head .line3 .title a{
display: block;
background-color: #000000;
line-height: 53px;
width: 120px;
text-align: center;
}

.head .line3 ul{
margin: 0;
}

.head .line3 li{
width: 90px;
text-align: center;
line-height: 53px;
}
.head .line3 li a:hover{
color: #DE4767;
border-bottom: 3px solid #DE4767;
line-height: 47px;
}

.head .line3 .active{
color: #DE4767;
border-bottom: 3px solid #DE4767;
line-height: 47px;
}

 

底部:

html部分:

 

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
<link rel="stylesheet" type="text/css" href="css/dibu.css"/>
</head>
<body>
<!-- div.foot>ul>li>a[href=#]{}*5 -->
<div class="f">
<div class="f1">
<ul>
<li>
<a href="#">关于我们</a>
<a href="#">人才招聘</a>
<a href="#">联系我们</a>
<a href="#">友情链接</a>
<a href="#">版权声明</a>
<a href="#">客服中心</a>
</li>
</ul>
</div>
<!-- div.foot2>ul>li>span*3 -->
<div class="f2">
<ul>
<li>
<img src="img/culture.png" >
<span>Copyright @ 2009-2016 yinyuetai.com 广播电视节目制作经营 许可证编号(京)字第1891号 </span>
<span>京网文[2014]2037-287号</span>
<span class="color">网络视听许可证0110413号</span>

</li>
</ul>
</div>
<div class="f3">
<ul>
<li>
<span>京公网安备1101052014900号</span>
<span>京ICP备11024134号-1</span>
<span>京ICP证060716号</span>
<span>出版物经营许可证 新出发京零字第朝130062号</span>
<span class="x">增值电信业务经营许可证B2-20140501</span>
<img class="img" src="img/biaoshi.gif" >
</li>
</ul>
</div>
<div class="f4">
<ul>
<li>食品经营许可s证:JY111050485336</li>
<li>营业执照</li>
</ul>
</div>
</div>
</body>
</html>

css部分:

*{
margin: 0px;
padding: 0px;
}
.f{
/*width: 1300px;*/
text-align: center;
background-color: #222;
height: 195px;
}
.f ul li{
display: inline-block;
}

.f .f1 ul li{
margin-top: 40px;
text-align: center;
}
.f .f1 a{
color: #666666;
border-right: 2px solid #999;
padding-right: 20px;
margin-lef: 10px;
font-size: 15px;
text-decoration: none;
}
.f .f1 a:last-child{
border-right: none;
}
.f .f2{
margin-top: 25px;
}

.f .f2 img{
width: 23px;
height: 23px;
margin-right: -5px;
margin-bottom: -5px;
}
.f .f2 span{
color: #CCCCCC;
font-size: 12px;
border-right: 1px solid #D3D3D3;
padding-right: 5px;
margin-left: 5px;
}
.f .f2 .color{
border-right: none;
color: greenyellow;
}

.f .f3 li{
margin-top: -40px;
margin-lef: 20px;

}
.f .f3 span{
color: #CCCCCC;
font-size: 12px;
border-right: 1px solid #D3D3D3;
padding-right: 5px;
}
.f .f3 span:last-child{
border-right: none;
}
.f .f3 .x{
border-right: none;
}
.f .f3 .img{
width: 35px;
height: 40px;
margin-lef: -10px;
}
.f .f4 li{
padding-right: 5px;
margin-lef: 5px;
color: #CCCCCC;
font-size: 12px;
border-right: 1px solid #D3D3D3;

}
.f .f4 li:last-child{
border-right: none;
}

 

推荐阅读