我说过,我很喜欢firefox的,很恨ie的,但是没办法,我总不能要求大家都用firefox吧,MS也不能因为大多数人的不喜欢(我相信是大多数)而停止对IE的开发吧。
不过,这种方法的缺点就是每一个属性都要去Hack.
写法很容易:
CSS代码
#something {
position: fixed;
#position: fixed;
_position: fixed;
}
第一排:给Firefox以及其他浏览器看
第二排:给IE7(可能以后的IE8、IE9也是如此,谁知道呢)看
第三排:给IE6以及更老的版本看
最好的应用就是可以让IE6也“支持”position:fixed,而且,配合这个原理,可以做到不引入JavaScript代码(仅用IE6的expression),这里有一个现成的页面,CSS如下写:
CSS代码
#ff-r {
position: fixed;
_position: absolute;
rightright: 15px;
top: 15px;
_top: expression(eval(document.compatMode &&
document.compatMode==‘CSS1Compat’) ?
documentElement.scrollTop+15 :
document.body.scrollTop +
(document.body.clientHeight
-this.clientHeight));
}



