实例
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>2.经典的三列双飞翼布局</title> <style type="text/css"> .header, .footer { widows: 100%;/*宽度自适应*/ height: 60px; background-color: lightblue; } .content { width: 1000px; min-height: 100%; background-color: lightskyblue; margin:auto; text-align: center; line-height: 60px;/*垂直居中*/ overflow: hidden; } .contenter { width: 1000px; margin:auto; background-color: red; } .wrap { width: 100%; float: left; background-color: cyan; } .wrap .main { min-height: 600px; background-color: wheat; margin:0 200px; } .left { width: 200px; min-height: 600px; float: left; margin-left: -100%; background-color: pink; } .right { width: 200px; min-height: 600px; float: left; margin-left: -200px; background-color: lightgreen; } .foot { float: both; } </style> </head> <body> <!-- DOM结构 --> <!-- 头部 --> <div class="header"> <div class="content">网站头部</div> </div> <!-- 主体 --> <div class="contenter"> <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>
运行实例 »
点击 "运行实例" 按钮查看在线实例