网站布局:
实例
<!DOCTYPE html> <html lang="zh"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta http-equiv="X-UA-Compatible" content="ie=edge"> <title>网站首页布局</title> <style type="text/css"> *{margin: 0; padding: 0;} li{list-style: none;} a{ text-decoration: none;} .header{ width: 90%; height: 70px; background: #000; margin: 0 auto;} .header .menu li{ width: 150px; text-align: center; float: left; } .header .menu li.active{background: lightseagreen;} .header .menu li a{ color: #fff; display: inline-block; width: 150px; height: 70px; line-height: 70px;} .header .menu li a:hover{background: lightseagreen; } .content{ width:90%; margin: 10px auto; overflow: hidden; border: 1px solid #ccc;} .content .center,.content .left,.content .right{ min-height: 800px; float: left;} .content .center{ box-sizing: border-box; width: 100%; background: #90EE90; padding-left: 250px; padding-right: 200px;} .content .left{ width: 250px; background: red; margin-left: -100%;} .content .right{ width:200px; background: blue; margin-left: -200px;} .content .left h2{ text-align: center; border-bottom: 1px dashed #ccc; line-height: 80px;} .content .left .procate li{ margin: 15px auto; padding-left: 15px; } .content .left .procate li a{color: #fff;} .content .center h3{border-bottom: 1px dashed #ccc; line-height: 80px; text-align: center;} .content .center .prolist{ padding-top: 20px;} .content .center .prolist li{ float: left; width: 160px; height: 200px; margin-bottom: 20px; margin-left: 5px;} .content .center .prolist li img{ width: 100%;} .content .center .prolist li p{ text-align: center; font-size: 1rem;} .content .right h3{border-bottom: 1px dashed #ccc; line-height: 80px; text-align: center;} .content .right .qiang{ padding-top: 20px;} .content .right .qiang li{ margin-bottom: 15px;} .content .right .qiang img{ width: 80%; display: block; margin: 0 auto;} .content .right .qiang p{ text-align: center; color: #fff;} .footer { box-sizing: border-box; width: 1200px; height: 60px; line-height: 60px; background: #999999; width: 90%; margin: 0 auto;text-align: center;} .footer a{ display:inline-block; text-align: center; color:#ccc; padding: 0px 10px; } </style> </head> <body> <div class="header"> <ul class="menu"> <li class="active"><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> <li><a href="">售后服务</a></li> <li><a href="">联系我们</a></li> </ul> </div> <div class="content"> <div class="center"> <h3>推荐产品</h3> <ul class="prolist"> <li><a href=""><img src="https://img12.360buyimg.com/n1/jfs/t1/72827/24/1320/318858/5cf7d494Ec543f873/1146ef79095cb4bc.jpg"><p>东北大米好大米</p><p>价格:88元</p></a></li> <li><a href=""><img src="https://img12.360buyimg.com/n1/jfs/t1/72827/24/1320/318858/5cf7d494Ec543f873/1146ef79095cb4bc.jpg"><p>东北大米好大米</p><p>价格:88元</p></a></li> <li><a href=""><img src="https://img12.360buyimg.com/n1/jfs/t1/72827/24/1320/318858/5cf7d494Ec543f873/1146ef79095cb4bc.jpg"><p>东北大米好大米</p><p>价格:88元</p></a></li> <li><a href=""><img src="https://img12.360buyimg.com/n1/jfs/t1/72827/24/1320/318858/5cf7d494Ec543f873/1146ef79095cb4bc.jpg"><p>东北大米好大米</p><p>价格:88元</p></a></li> <li><a href=""><img src="https://img12.360buyimg.com/n1/jfs/t1/72827/24/1320/318858/5cf7d494Ec543f873/1146ef79095cb4bc.jpg"><p>东北大米好大米</p><p>价格:88元</p></a></li> <li><a href=""><img src="https://img12.360buyimg.com/n1/jfs/t1/72827/24/1320/318858/5cf7d494Ec543f873/1146ef79095cb4bc.jpg"><p>东北大米好大米</p><p>价格:88元</p></a></li> <li><a href=""><img src="https://img12.360buyimg.com/n1/jfs/t1/72827/24/1320/318858/5cf7d494Ec543f873/1146ef79095cb4bc.jpg"><p>东北大米好大米</p><p>价格:88元</p></a></li> <li><a href=""><img src="https://img12.360buyimg.com/n1/jfs/t1/72827/24/1320/318858/5cf7d494Ec543f873/1146ef79095cb4bc.jpg"><p>东北大米好大米</p><p>价格:88元</p></a></li> <li><a href=""><img src="https://img12.360buyimg.com/n1/jfs/t1/72827/24/1320/318858/5cf7d494Ec543f873/1146ef79095cb4bc.jpg"><p>东北大米好大米</p><p>价格:88元</p></a></li> <li><a href=""><img src="https://img12.360buyimg.com/n1/jfs/t1/72827/24/1320/318858/5cf7d494Ec543f873/1146ef79095cb4bc.jpg"><p>东北大米好大米</p><p>价格:88元</p></a></li> <li><a href=""><img src="https://img12.360buyimg.com/n1/jfs/t1/72827/24/1320/318858/5cf7d494Ec543f873/1146ef79095cb4bc.jpg"><p>东北大米好大米</p><p>价格:88元</p></a></li> <li><a href=""><img src="https://img12.360buyimg.com/n1/jfs/t1/72827/24/1320/318858/5cf7d494Ec543f873/1146ef79095cb4bc.jpg"><p>东北大米好大米</p><p>价格:88元</p></a></li> <li><a href=""><img src="https://img12.360buyimg.com/n1/jfs/t1/72827/24/1320/318858/5cf7d494Ec543f873/1146ef79095cb4bc.jpg"><p>东北大米好大米</p><p>价格:88元</p></a></li> <li><a href=""><img src="https://img12.360buyimg.com/n1/jfs/t1/72827/24/1320/318858/5cf7d494Ec543f873/1146ef79095cb4bc.jpg"><p>东北大米好大米</p><p>价格:88元</p></a></li> </ul> </div> <div class="left"> <h2>产品分类</h2> <ul class="procate"> <li><a href="">产品分类1</a></li> <li><a href="">产品分类2</a></li> <li><a href="">产品分类3</a></li> <li><a href="">产品分类4</a></li> <li><a href="">产品分类5</a></li> <li><a href="">产品分类6</a></li> <li><a href="">产品分类7</a></li> <li><a href="">产品分类8</a></li> <li><a href="">产品分类9</a></li> <li><a href="">产品分类10</a></li> </ul> </div> <div class="right"> <h3>抢好货</h3> <ul class="qiang"> <li><img src="static/images/girl.jpg" alt=""><p>大美女</p></li> <li><img src="static/images/girl.jpg" alt=""><p>大美女</p></li> <li><img src="static/images/girl.jpg" alt=""><p>大美女</p></li> </ul> </div> </div> <div class="footer"> <a href="">电话:010-888888</a> <a href="">地址:人民广场东200米</a> <a href="">邮箱:liuliu@qq.com</a> </div> </body> </html>
运行实例 »
点击 "运行实例" 按钮查看在线实例