`

IE6 识别fixed;

 
阅读更多

  <style>
  #top{
  position:fixed;
  _position:absolute;
  bottom:0;
  right:20px;
  _bottom:auto;
  _top:expression(eval(document.documentElement.scrollTop+document.documentElement.clientHeight-this.offsetHeight-(parseInt(this.currentStyle.marginTop,10)||0)-(parseInt(this.currentStyle.marginBottom,10)||0)));
 }
  /*right 跟 left 属性可以用绝对定位的办法解决,而 top 跟 bottom 就需要用上面的表达式来实现。其中在 _position:absolute; 中的 _ 符号只有 IE6 才能识别,目的是为了区分其他浏览器。
 其中 * 是给 IE6 识别的。
    解决闪动问题的办法是在 CSS 文件中加入:
*/
*html{
background-image:url(about:blank);
background-attachment:fixed;
}

  </style>
 </head>

 <body style="height:1000px;">
 
 <div id="top">...</div>

 </body>

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics