IE z-index relative/absolute bug in list

后端 未结 8 1887
迷失自我
迷失自我 2020-12-31 08:12

I have the following navigation where .topNav has position:relative and subnav has position:absolute. I cant get the sublist to appear over the main list due to z-index prob

8条回答
  •  刺人心
    刺人心 (楼主)
    2020-12-31 08:54

    Here's a very good article that explains the stacking issues that machineghost mentions.

    http://css-discuss.incutio.com/wiki/Overlapping_And_ZIndex

    What you might want to consider (depending on why you're wanting the positioning on multiple elements) is adding a hover selector to .base (use JavaScript for IE6) that adds the class to give it relativity.

    .base:hover{position:relative;}
    

    This then means that the second .base doesn't have position: relative.

提交回复
热议问题