`

div固定位置,不随滚动条滚动

阅读更多
<html>
<head>
    <title>div固定位置,不随滚动条滚动</title>
    <style type="text/css">
        html,body {
            overflow:hidden;
            margin:0px;
            width:100%;
            height:100%;
        }
        .virtual_body {
            width:100%;
            height:100%;
            overflow-y:scroll;
            overflow-x:auto;
        }
        .fixed_div {
            position:absolute;
            z-index:2008;
            bottom:20px;
            left:40px;
            width:800px;
            height:40px;
            border:1px solid red;
            background:#e5e5e5;
        }
    </style>
</head>
<body>
<div class="fixed_div">我永远在这里,哪也不去</div>
<div class="virtual_body">
    <div style="height:888px;">
    	<br/><br/><br/><br/><br/><br/><br/><br/><br/>
        滚动条是把杀猪刀
    </div>
</div>
</body>
</html>

 

1
0
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics