一个解决IE6下固定定位问题的小示例,代码如下:
<style type="text/css">
html, body {
margin:0;
padding:0;
overflow:hidden;
height:100%;
text-align:left;
}
.body {
position:relative;
height:100%;
overflow-y:scroll;
overflow-x:auto;
cursor:default;
}
.box {
position:absolute;
z-index:999;
margin:0 auto;
bottom:10px;
left:40px;
height:40px;
border:1px solid #369;
background:#f7f7f7;
line-height:40px;
}
</style>
<div class="box">我是不会被你拖着走的!</div>
<div class="body">
<p style="margin: 15px;">看屏幕底端的区块,再拖动浏览器的滚动条,结果怎么样?满意吧,惊喜吧!</p>
<div style="height: 1000px;"> </div>
</div>



新浪微博
腾讯微博