ITeye博客

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

doPPP · 2013-01-29 09:13 · Js Jquery · Web前端 · Markdown

<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>

评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。