• 彪悍的人生不需要解释

两种解决IE6不支持固定定位的方法

有两种让IE6支持position:fixed

1.用CSS执行表达式

*{margin:0;padding:0;}
* html,* html body{ 
	background-image:url(about:blank);
 	background-attachment:fixed;
}
* html .fixed{
    position:absolute;
    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)));
}      
.fixed{
    position:fixed;
    bottom:0px;
    top:auto;
}   

查看演示

2.让body保持其原有高度,让html只有一个窗口那么高

*{margin:0;padding:0}
*html{overflow:hidden;}
*html body{height:100%;overflow:auto;}        
.fixed{
    position:fixed; _position:absolute;
    left:0;
    bottom:0;
}
查看演示

推荐阅读
http://tagsoup.com/cookbook/css/fixed/
http://subtlegradient.com/

Give lefter a comment

Your comment