【问题标题】:z-index and Chrome 26z-index 和 Chrome 26
【发布时间】:2013-04-03 00:24:32
【问题描述】:

z-index 不适用于 Chrome 版本 26,因为我有 2 个 div

 <style>
      #div1{
           position:relative;
           z-index:1000;
         }
      #div2{
           position:absolute;
           z-index:10001;
 </style>

它在 Firefox 上运行良好,但在 Chrome 上却不行。

【问题讨论】:

标签: html css google-chrome z-index


【解决方案1】:

您有语法错误。您缺少右大括号。

#div1 {
    position:relative;
    z-index:1000;
}
#div2 {
    position:absolute;
    z-index:10001;
}

jsfiddle.net/kUmYh

【讨论】:

  • 对不起,但是在我的实际代码中我没有错过..仍然有问题
  • @RemonAmin - 请张贴jsfiddle 证明问题。我没有看到它:jsfiddle.net/kUmYh
  • @RemonAmin - 你更新的 jsfiddle 有一个唯一的 URL。请分享它的链接。
  • @RemonAmin - 你的 jsfiddle 中有一个额外的花括号。 When the syntax error is corrected,它按我的预期显示。 Div2 具有比 Div1 更高的 z-index 并显示在 Div1 上方。
  • 您是否尝试从父 div 示例开始:#parentDiv #div2 {position:absolute; z-index:10001;}
猜你喜欢
  • 2011-05-17
  • 2011-04-24
  • 1970-01-01
  • 1970-01-01
  • 2015-11-11
  • 1970-01-01
  • 2012-12-01
  • 2015-10-17
相关资源
最近更新 更多