体会双飞翼布局实例
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>双飞翼布局案例</title> </head> <style type="text/css"> * { margin: 0; padding: 0; } li { list-style: none; } a { text-decoration-line: none; } h1 { margin: 20px auto; text-align: center; } body { font-size: 18px; } .header, .footer{ overflow: hidden; background-color: lightgrey; } .header .cont, .footer .cont{ width: 1200px; height: 60px; margin: 0 auto; background-color: black; } .header .cont .nav .item a { float: left; color: white; width: 100px; height: 60px; line-height: 60px; text-align: center; } .header .cont .nav .item a:hover { background-color: red; font-size: 20px; } .container { width: 1200px; margin: 10px auto; overflow: hidden; background-color: lightseagreen; } .warp { float: left; width: inherit; min-height: 650px; background-color: lightgreen; } .warp .main { padding: 0 200px; } .left { float: left; width: 200px; min-height: 650px; margin-left: -100%; background-color: lightcoral; } .right { float: left; width: 200px; min-height: 650px; margin-left: -200px; background-color: lightskyblue; } .footer .cont p { text-align: center; } .footer .cont a { display: inline-block; color: lightgrey; line-height: 60px; } .footer .cont b { color: lightgrey; margin: 0 10px; } .footer .cont a:hover, .footer .cont b:hover{ color: white; } </style> <body> <h1>体会双飞翼布局实例</h1> <div class="header"> <div class="cont"> <ul class="nav"> <li class="item"><a href="">首页</a></li> <li class="item"><a href="">企业新闻</a></li> <li class="item"><a href="">图片新闻</a></li> <li class="item"><a href="">关于我们</a></li> <li class="item"><a href="">联系我们</a></li> </ul> </div> </div> <div class="container"> <div class="warp"> <div class="main">这是主体内容</div> </div> <div class="left">左侧区块</div> <div class="right">右侧区块</div> </div> <div class="footer"> <div class="cont"> <p><a href="">©猴子哥哥版权所有</a><b> | </b><a href="">PHP语言</a><b> | </b><a href="">javascript</a><b> | </b><a href="">bootstrap</a></p> </div> </div> </body> </html>
运行实例 »
点击 "运行实例" 按钮查看在线实例