/*fixed 兼容解决方案*/
*html{
background-image:url(about:blank); background-attachment:fixed;
}
/*距离顶部固定位置(表达式里面的y可以换成某个数值。距离为10px就写10)*/
.fixed-top{
position: fixed; top:0px; _top:expression(eval(document.documentElement.scrollTop+y));
}
/*距离底部部固定位置(表达式里面的y可以换成某个数值。距离为10px就写10)*/
.fixed-bottom{
position: fixed; bottom:0px; _top:expression(eval(document.documentElement.scrollTop+document.documentElement.clientHeight-this.offsetHeight-(parseInt(this.currentStyle.marginTop,10)||0)-(parseInt(this.currentStyle.marginBottom,10)||0)-y)); }
.fixed{
_position: absolute; _bottom: auto;
}
样式里面那个y.就是个距离值。根据你要设置的大小相应的进行更改。
至于左右位置,就简单了left和right。设置个值就可以了。
对应的元素
首先,在IE浏览器,IE9支持W3C标准以下版本是不完美的,所以你只要按照W3C CSS书面标准,然后在IE浏览器可能无法正常显示。
的CSS,如果你想与其他版本的IE浏览器兼容,您必须了解CSS破解,这取决于浏览器的CSS定义不同的属性,可以与更多的浏览器兼容