开发者

Drop-down menu won't behave

开发者 https://www.devze.com 2023-04-12 19:09 出处:网络
Here is the link to the fiddle : http://jsfiddle.net/UL2LB/1/ 开发者_开发知识库 As you can see, I only have specified z-indexes on the hidden sub-list and the nav element, both of which have explicit

Here is the link to the fiddle : http://jsfiddle.net/UL2LB/1/

开发者_开发知识库

As you can see, I only have specified z-indexes on the hidden sub-list and the nav element, both of which have explicit positioning. So my question is, why the hell is my sub-menu still showing on top of the <nav>?

Thank you in advance for any answer.


Give your ul a pixel width and add position:relative to it the li.

nav.global ul li ul {
    width:180px;
    ...
}

nav.global > ul > li {
    display: inline-block;
    margin-left: 2%;
    position: relative;
}
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号