IE6 CSS bug: position:relative元素被overflow:auto/scroll元素

BUG描述:

页面中某DIV使用了position:relative,结合top=-25px等元素定位。在FF和IE7下表现正常,但是在IE6中该DIV会随鼠标滚动而滚动。

 

分析:

这是IE6一个已知的BUG:当某position:relative元素被带有overflow:auto/scroll属性的块级元素包含时,会表现出postion:absolute的行为。

 

解决方法:

1.为包含块元素添加属性position:relative

2.把该元素的position:relative属性去掉,使用默认的static定位,并通过margin-top等属性实现类似的效果。

IE6 CSS bug: position:relative元素被overflow:auto/scroll元素

相关文章:

你感兴趣的文章:

标签云: