position:fixed; IE6下解决办法。。

<!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 { 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;
             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>

  

原文地址:https://www.cnblogs.com/huanlei/p/2346803.html