美文网首页
css+div 实现上中下左右布局

css+div 实现上中下左右布局

作者: Silence11 | 来源:发表于2016-10-31 16:57 被阅读0次

    css+div 实现上中下布局

    <!doctype html>
    <html> 
    <head>
    <meta charset="utf-8">
    <title>div+css上中下左右布局</title>
    <style>
    html,body {height:100%; *overflow:hidden; /* 消除IE7下的横向滚动条 */}
    body {margin:0; padding:0; font-size:30px; text-align:center;  }
    .top ,.nav ,.foot {width:100%; height:100px; position:absolute;}
    .top {border:solid 1px red; top:0;} 
    .nav {border:solid 1px blue; top:100px; bottom:100px; height:auto;} 
    .foot {border:solid 1px red; bottom:0;}  
    .left{ height: 100%; position: absolute; width:14%; border: solid 1px red;}  
    .right{ border: solid 1px red; position: absolute;  margin-left:14%;  height: 100%; width: 100%;}
    </style> 
    </head>
    <body>
        <div class="top">我是头部</div>
        <div class="nav"> 
        <div class="left"> 左 </div>
        <div class="right">右</div> 
        </div>
        <div class="foot">我是底部</div>
    </body>
    </html>
    
    QQ图片20161031165813.png

    相关文章

      网友评论

          本文标题:css+div 实现上中下左右布局

          本文链接:https://www.haomeiwen.com/subject/vseputtx.html