您的位置:首页 > 其它

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

2013-02-06 17:10 190 查看
Html代码







<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>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: