摘要:<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>小米商城</title> <link rel="shortcut icon" type="image/
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>小米商城</title> <link rel="shortcut icon" type="image/x-icon" href="images/footlogo.png"> <link rel="stylesheet" type="text/css" href="font-awesome/css/font-awesome.min.css"> <link rel="stylesheet" type="text/css" href="css/style.css"> <script type="text/javascript" src="js/jquery-3.3.1.min.js"></script> </head> <body> <header> <div>头部</div> </header> <div> <div>主题1 <div> <div>导航</div> <div> <div></div> <div></div> </div> <div> <div></div> <div><a href="#"></a></div> <div><a href="#"></a></div> <div><a href="#"></a></div> </div> <div> <div><h2>小米闪购</h2></div> <div> <div></div> <ul> <li><a href="#"></a></li> <li><a href="#"></a></li> <li><a href="#"></a></li> <li><a href="#"></a></li> </ul> </div> </div> <div><a href="#"></a></div> </div> </div> <div>主题2 <div> <div>手机</div> <div><a href="#"></a></div> <div>家电</div> <div><a href="#"></a></div> <div>智能</div> <div><a href="#"></a></div> <div>搭配</div> <div><a href="#"></a></div> <div>配件</div> <div><a href="#"></a></div> <div>周边</div> <div><a href="#"></a></div> <div>为你推荐</div> <div>热评产品</div> <div>内容</div> <div>视频</div> </div> </div> </div> <footer>底部</footer> </body> </html>
/*通用设置*/
*{margin:0px;padding: 0px;}
li{
list-style: none;
}
a{
text-decoration: none;
}
.clear{
clear: both;
}
/*头部*/
header{
width: 100%;
height: 60px;
background-color: #333;
}
header div{
width: 1226px;
height: 60px;
margin:0 auto;
}
/*内容*/
.counts{
width: 100%;
}
/*内容1*/
.counts .count-1{
width: 100%;
overflow: hidden;
background-color: #fff;
}
.centers{
width: 1226px;
margin:0 auto;
overflow: hidden;
}
.centers .meau,.centers .pic,.centers .show,.centers .img-g,.centers .gg{
width: 100%;
margin-top: 10px;
background-color: #ccc;
}
.centers .meau{
height: 80px;
}
/*焦点轮播*/
.centers .pic{
overflow: hidden;
}
.pic-l{
width: 246px;
height: 480px;
background: #222;
float: left;
}
.pic-r{
width: 980px;
height: 480px;
background: #ccc;
float: right;
}
.centers .show{
height: 170px;
}
.show-1{
width: 246px;
height: 170px;
float: left;
margin-right: 2px;
background: red;
}
.show-2,.show-3,.show-4{
width: 317px;
height: 170px;
float: left;
margin-left: 9px;
}
.show-2 a,.show-3 a,.show-4 a{
display: block;
width: 317px;
height: 170px;
}
.show-2{
background: url(../images/midAD1.jpg);
}
.show-3{
background: url(../images/midAD2.jpg);
}
.show-4{
background: url(../images/midAD3.jpg);
}
.centers .gg{
overflow: hidden;
}
.gg-1{
height: 30px;
background: #666;
margin:10px 0px;
}
.gg-1 h2{
float: left;
width: 236px;
padding-left: 10px;
background: #ffc;
}
.gg-2{
height: 340px;
overflow: hidden;
}
.gg-2 .gg-2-1{
width: 246px;
height: 339px;
float: left;
border-top: 1px solid red;
background: blue;
}
.gg-2 .gg-2-2{
width: 980px;
height: 339px;
float: left;
}
.gg-2 ul li{
float: left;
margin-left: 10px;
background: #777;
overflow: hidden;
}
.gg-2 ul li a{
display: block;
width: 235px;
height: 339px;
}
.gg-2 .li-1{
border-top: 1px solid orange;
}
.gg-2 .li-2{
border-top: 1px solid blue;
}
.gg-2 .li-3{
border-top: 1px solid green;
}
.gg-2 .li-4{
border-top: 1px solid red;
}
.centers .img-g{
height: 119px;
background: url(../images/longAD1.jpg);
margin-bottom: 10px;
}
.centers .img-g a{
display: block;
height: 119px;
}
/*内容2*/
.counts .count-2{
width: 100%;
overflow: hidden;
background-color: #f5f5f5;
}
/*手机部分*/
.count-2 .mobile{
height: 500px;
background: pink;
margin-bottom: 10px;
}
.count-2-img{
background: url(../images/longAD2.jpg);
}
/*家电*/
.count-2 .home-appliance{
height: 400px;
background: #fff;
margin-bottom: 10px;
}
.count-2-img1{
background: url(../images/longAD3.jpg);
}
/*内容2,所有放置图片的地方*/
.count-2 .count-2-img,.count-2-img1,.count-2-img2,.count-2-img3,.count-2-img4,.count-2-img5{
height: 119px;
margin-bottom: 10px;
}
.count-2 .count-2-img a,.count-2-img1 a,.count-2-img2 a,.count-2-img3 a,.count-2-img4 a,.count-2-img5 a{
display: block;
height: 119px;
}
/*智能区域*/
.count-2 .smart{
height: 300px;
margin-bottom: 10px;
background: red;
}
.count-2-img2{
background: url(../images/longAD4.jpg);
}
/*搭配区域*/
.count-2 .collocation{
height: 400px;
margin-bottom: 10px;
background: #333;
}
.count-2-img3{
background: url(../images/longAD5.jpg);
}
/*配件部分*/
.count-2 .accessories{
height: 400px;
margin-bottom: 10px;
background: blue;
}
.count-2-img4{
background: url(../images/longAD6.jpg);
}
/*周边*/
.count-2 .the-surrounding{
height: 400px;
margin-bottom: 10px;
background: orange;
}
.count-2-img5{
background: url(../images/longAD7.jpg);
}
/*为你推荐*/
.count-2 .recommended{
height: 400px;
margin-bottom: 10px;
background: orange;
}
/*热评产品*/
.count-2 .high-praise{
height: 400px;
margin-bottom: 10px;
background: orange;
}
/*精彩内容*/
.count-2 .txt{
height: 400px;
margin-bottom: 10px;
background: orange;
}
/*视频*/
.count-2 .video{
height: 400px;
margin-bottom: 10px;
background: orange;
}
/*底部*/
footer{
width: 100%;
height: 100px;
background-color: #fff;
}
效果图
在浮动的外面套个DIv也可以啊。