Correction status:qualified
Teacher's comments:
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>比翼双飞布局</title> <style type="text/css"> .header,.footer{width: 100%;height: 60px;background-color: dimgray;} .content{width:1000px;min-height: 100%;text-align: center;line-height: 60px; background-color: #2A98FF;margin: auto;} .container{width: 1000px;margin: auto;background-color: yellow;overflow: hidden;} .wrap{width: 100%;float: left;background-color: rebeccapurple;} .main{min-height: 600px;background-color: wheat;margin: 0 200px;} .left{width: 200px;float: left;min-height: 600px;background-color: chartreuse;margin-left: -1000px;} .right{width: 200px;float: left;min-height: 600px;background-color: red;margin-left: -200px;} .footer{ clear: both;} </style> </head> <body> <div class="header"> <div class="content">网站头部</div> </div> <!-- 主体 --> <div class="container"> <div class="wrap"> <div class="main">主体内容区</div> </div> <div class="left">左侧</div> <div class="right">右侧</div> </div> <!-- 底部 --> <div class="footer"> <div class="content">网站底部</div> </div> </body> </html>
点击 "运行实例" 按钮查看在线实例
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>圣杯布局</title> <style type="text/css"> .header,.footer{width:100%;height: 60px;background-color: ;} .content{width: 1000px;text-align: center;line-height:60px; margin: auto;background-color:hotpink} .container{width: 600px;margin: auto;overflow: hidden; background-color: navajowhite;padding: 0 200px;} .main{width:100%;background-color: #2A98FF;float: left; min-height: 600px; } .left{width: 200px;background-color: chartreuse;float: left; min-height: 600px;margin-left: -100%; position: relative; left:-200px; } .right{width: 200px;background-color: blue;float: left; min-height: 600px; margin-left: -200px; position: relative; right:-200px; } .footer{ clear: both;} </style> </head> <body> <div class="header"> <div class="content">网站头部</div> </div> <!-- 内容区 --> <div class="container"> <div class="main">主体</div> <div class="left">左侧</div> <div class="right">右侧</div> </div> <!-- 底部 --> <div class="footer"> <div class="content">网站底部</div> </div> </body> </html>
点击 "运行实例" 按钮查看在线实例