BUG描述:
页面中某div使用了position:relative,外部有元素overflow:auto/scroll。在FF和IE7下表现正常,但是在IE6中该div会随鼠标滚动而滚动。
分析:
这是IE6一个已知的BUG:当某position:relative元素外有overflow:auto/scroll属性的块级元素包含时,会表现出postion:absolute的行为。
解决方法:
外部元素添加属性position:relative。
把该元素的position:relative属性去掉,使用默认的static定位,并通过margin-top等属性实现类似的效果。
代码结构如下
1 <ul style="overflow-y:scroll;"> 2 <li><div style="position:relative;"></div></li> 3 <li></li> 4 </ul>