3月27日作业提交
实例
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>三分结构</title> <style> body,ul,li{ padding: 0; margin:0; } body{ background-color: #e9e9e9; background-image: url('/images/gufeng.jpg'); background-repeat: no-repeat; } .header{ width: 100%; height: 200px; background-color: lightskyblue; } .footer{ width: 100%; height: 40px; background-color: lightblue; } .container{ width: 80%; min-height: 800px; background-color: cyan; margin:auto; /*一定要加上overflow*/ overflow: hidden; } .main{ width: 100%; height: 800px; background-color: lightblue; float: left; } .main .content{ background-color: cyan; height:800px; } .left{ float: left; height: 800px; width: 20%; background-color: green; margin-left: -100%; } .right{ float: left; height: 800px; width: 20%; background-color: wheat; position: relative; margin-left: -20%; } </style> </head> <body> <div class="header"></div> <div class="container"> <div class="main"> <div class="content"></div> </div> <div class="left"></div> <div class="right"></div> </div> <div class="footer"></div> </body> </html>
运行实例 »
点击 "运行实例" 按钮查看在线实例
手抄代码