【问题标题】:Internet explorer z-index issueInternet Explorer z-index 问题
【发布时间】:2011-11-28 12:41:59
【问题描述】:

在这个网站上:http://rwl.rwlwater.com/ 当我有更多菜单时,它会将搜索栏移动到下一行,但它仍然可以在特色滑块上看到。在 Firefox 中,这不会发生,并且搜索栏不可见。

我尝试更改滑块 div 和搜索栏 div 的 z-index,但它不起作用。

【问题讨论】:

  • 您是否将每个元素都设置为“位置:相对”?您是否设置了 ie 使用的 doctype?
  • 即使在 IE9 中也不起作用,问题不仅在于 ie7 和 ie8 。是的,我尝试设置 position: relative to all the elements

标签: css internet-explorer z-index


【解决方案1】:

因为您尝试堆叠的 div 位于两个不同的上下文中(即它们嵌套在其他 div 中,因此它们不是兄弟姐妹),您将无法直接设置它们的 z-index。

我认为您必须设置作为另一个实际兄弟的父级的 z-index...所以由于 #top 和 #content-full 是兄弟姐妹,您可能需要设置 z-index的 #top 具有更高的数字。这也意味着您必须将 #top 定位到默认静态之外的其他位置。

【讨论】:

  • 我将 content-full 的 z-index 更改为 100,它起作用了!谢谢
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2010-11-12
  • 1970-01-01
  • 2014-03-31
  • 2012-06-11
  • 2011-05-04
相关资源
最近更新 更多