今天做项目遇到IE position:relative bug,找到一篇文章,随便翻译下,说明情况

<div ></div>
</div>

添加CSS:

#container {
height:100px;
border:1px solid blue;
overflow:auto;
}
#a {
height:200px;
background-color:lightblue;
float:left;
width:60px;
}
#b {
position:relative;
height:200px;
background-color:pink;
width:60x;
}

表现如下图,粉红色背景元素出现了溢出,不受容器的overflow:hidden控制。


IE 7 position:relative bug

解决方法是给设置position:relative元素的容器也设置一个position:relative属性。

相关文章:

  • 2021-11-23
  • 2022-01-28
  • 2022-02-11
  • 2021-09-10
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-01-26
  • 2021-09-04
  • 2021-10-05
  • 2021-12-31
  • 2021-11-11
  • 2022-02-05
相关资源
相似解决方案