position:fixed; IE6下解决办法。。
2012-02-11 16:19
344 查看
<!DOCTYPE HTML> <html lang="en"> <head> <meta charset="UTF-8"> <title></title> <style type="text/css"> * { margin:0; padding:0; } html { background:url(about:blank) fixed; } body { height:2000px; } .box { width:100px; height:80px; background:#3cf; position:fixed; _position:absolute; _top:expression(offsetParent.scrollTop + 10); top:10px; right:20px; } </style> </head> <body> <div class="box"></div> </body> </html>
一、html { background:url(about:blank) fixed; } 解决ie6下,下拉滚动条有抖动现象。 about:blank 可以是任何并不存在的文件,如:url(123);
二、top:expression(offsetParent.scrollTop + 10) 如果是距离头部0px的话,那么应该top:expression(offsetParent.scrollTop) top: expression(offsetParent.scrollTop + offsetParent.clientHeight-offsetHeight) 如果是想要层在网页底部的话用这个。
其他方法:
<!DOCTYPE HTML> <html> <head> <title>fixbox</title> <meta charset="utf-8"> <style> html,body{ height: 100%; overflow: hidden; margin: 0; } .m-window{ background-color: #add8e6; height: 100%; overflow: auto; } .fixbox { position: absolute; width: 100px; height: 100px; bottom: 0; right: 15px; background-color: #00bfff; } </style> </head> <body> <div class="m-window"> <div class="fixbox"></div> <div class="m-body" style="height: 10000px">虚拟的body</div> </div> </body> </html>
相关文章推荐
- ie6下不支持position:fixed的解决办法
- IE6不兼容position:fixed的解决办法(CSS里写js)
- 解决在IE6 下,css中的position:fixed 不起作用的办法
- IE6下position:fixed不固定的解决办法
- 关于IE6不支持position:fixed的解决办法
- IE6不兼容position:fixed属性的解决办法分享
- 解决ie6不支持position: fixed;导致无法滚动的办法
- ie8 不支持 position:fixed 的简单解决办法
- 解决IE6不支持position:fixed的bug
- 完美解决IE6不支持position:fixed…
- IE6中position:fixed无效问题解决
- position:fixed的解决办法!
- 实现 IE6 下支持 position-fixed 的 CSS 属性并解决“振动”的问题
- 完美解决IE6不支持position:fixed的bug
- 解决IE6不支持position:fixed的bug
- 解决IE6浏览器下position:fixed固定定位问题
- 真正完美解决IE6下position:fixed问题的方法{使用expression()没有抖动}
- 解决IE6浏览器下position:fixed固定定位不抖动的问题
- ie6不兼容position:fixed的解决方法
- 完美解决IE6浏览器下不兼容position:fixed固定定位