摘要:<!DOCTYPE html> <html> <head> <meta charset="UTF-8" /> <title>小米商城</title> &nbs
<!DOCTYPE html> <html> <head> <meta charset="UTF-8" /> <title>小米商城</title> <link rel="shortout icon" type="image/x-icon" href="static/img/footlogo.png" /> <link rel="stylesheet" type="text/css" href="static/font-awesome/css/font-awesome.min.css" /> <link rel="stylesheet" type="text/css" href="static/css/style.css" /> </head> <body> <!-- 头部 --> <div class="header"> <div class="menu"> 网站头部 </div> </div> <div class="clear"></div> <!-- 主体 --> <div class="contents"> <div class="content"> <div class="contentMenu"></div> <div class="contentPic"></div> <div class="contentPic_ul"></div> <div class="contentShop"></div> <div class="contentImg" style="background:url(static/img/longAD1.jpg);"></div> <div class="contentUl">手机</div> <div class="contentPhone"></div> <div class="contentImg" style="background:url(static/img/longAD2.jpg);"></div> <div class="contentUl">智能</div> <div class="contentPhone"></div> <div class="contentImg" style="background:url(static/img/longAD3.jpg);"></div> <div class="contentUl">家电</div> <div class="contentPhone"></div> <div class="contentImg" style="background:url(static/img/longAD4.jpg);"></div> </div> </div> <!-- 底部 --> <div class="footers"> <div class="footer">网站底部</div> </div> </body> </html>
*{margin: 0px; padding: 0px;border: none;}
li{list-style: none;}
a{text-decoration:none;}
.clear{clear:both;}
/*头部*/
.header{width: 100%;height: 40px;background: #333;}
.menu{background: #ccc; margin: 0px auto; height: 40px; width: 1226px;}
/*主体*/
.content{margin: 0px auto; width: 1226px;}
.contentMenu{background: #ccc; margin: 10px auto; height: 90px; }
.contentPic{background: #ccc; margin: 10px auto; height: 480px; }
.contentPic_ul{background: #ccc; margin: 10px auto; height: 150px; }
.contentShop{background: #ccc; margin: 10px auto; height: 300px; }
.contentImg{background:#ccc;margin:10px auto;height:120px}
.contentUl{background: #ccc; margin: 10px auto; height: 80px; }
.contentPhone{background: #ccc; margin: 10px auto; height: 450px;}
/* 底部*/
.footer{background: #ccc; height: 100px; width: 1226px;margin: 0px auto; }样式表布局重要的一点是思路要清晰,每个模块都要在脑子里有印象,一块块往里面方就可以了。