代码之家  ›  专栏  ›  技术社区  ›  Brad

显示在其下方的DIV下的“超级”下拉菜单

  •  1
  • Brad  · 技术社区  · 16 年前

    它正在做什么的示例: http://screenr.com/k2X

    我将DIV class=“container_12 header”的z-index设置为2,将DIV class=“container_12 content”设置为1。

    ul class=“sf menu”被设置为99,它在容器的头分区内。

    我以前遇到过这个问题,我认为为类适当地设置z索引可以解决这个问题,但是它仍然给了我一个问题,即在下面的DIV后面显示下拉菜单(container_12 content)。

    感谢您的帮助。

    .container_12.content {
      z-index: 1;
    }
    
    .container_12.header {
      background-color:#030;
      height:125px;
      border:1px solid yellow;
      z-index: 2;
    }
    
    2 回复  |  直到 16 年前
        1
  •  5
  •   cusspvz    16 年前

    超级菜单和注销按钮所在的DIV具有属性 overflow:scroll; 把它变成 visible .

    overflow:visible;
    z-index:0;
    position:relative;
    

    注释 :z-index仅适用于定位元素(位置:绝对、位置:相对或位置:固定)。

    编辑:为了获得最佳结果,加载 htmlreset.css 以前!

        2
  •  0
  •   Boris Delormas    16 年前

    你的沙发和保险商实验室的位置?我认为z-index只适用于位置选择器。

    推荐文章