兼容具体写法很容易:
#someNode { position: fixed; #position: fixed; _position: fixed; }
第一排给Firefox以及其他浏览器看 第二排给IE7(可能以后的IE8、IE9也是如此,谁知道呢)看 第三排给IE6以及更老的版本看 最好的应用就是可以让IE6也“支持”position:fixed,而且,配合这个原理,可以做到不引入JavaScript代码(仅用IE6的expression),我这里有一个现成的页面,CSS如下写:
#ff-r { position: fixed; _position: absolute; right: 15px; top: 15px; _top: expression(eval(document.compatMode && document.compatMode=='CSS1Compat') ? documentElement.scrollTop+15 : document.body.scrollTop + (document.body.clientHeight -this.clientHeight)); }
是不是很方便:) 兼容
|