码迷,mamicode.com
首页 > Web开发 > 详细

网页布局//上左不动,其他滑动

时间:2017-07-06 18:41:54      阅读:191      评论:0      收藏:0      [点我收藏+]

标签:doctype   列表   ack   布局   margin   relative   htm   har   width   

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Document</title>
</head>
<style>
    /*上左不动,其他的可以滑动*/
    *{
        margin: 0px;
        padding:0px;
    }
    #one{
        background:#1DC9D8;
        z-index:1;
        width:100%;
        height: 100px;
        position: fixed;
        margin-top: -100px;
    }
    #content{
        margin-top: 100px;
        position:relative;
        width:100%;
        height:2000px;
    }
    #right{
        background:yellow;
        width:20%;
        height:400px;
        position: fixed;
        z-index: 1;
        
    }
    
    #left{
        background:pink;
        width:80%;
        float:right;
        height:1800px;
    
    }
    #foot{
        background:#37E519;
        width:100%;
        height:150px;
        position:relative;
    }
</style>
<body>
    <div>
        <div id="one">首页</div>
        <div id="content">
            <div id="right">列表</div>
            <div id="left">内容</div>
        </div>
        <div id="foot">底部</div>
    </div>
</body>
</html>

网页布局//上左不动,其他滑动

标签:doctype   列表   ack   布局   margin   relative   htm   har   width   

原文地址:http://www.cnblogs.com/zouyun/p/7127258.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!