在很多实践中,只用‘修正’1-2个属性就可以了。
#someNode
{
position: fixed; <!--Firefox-->
#position: fixed; <!--IE7-->
_position: fixed; <!--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));
}