开发者

overlapping floats: z-index doesn't work

开发者 https://www.devze.com 2023-02-17 21:20 出处:网络
I\'m trying to write a ho开发者_开发问答rizontal navigation bar with simple drop down menus (again horz). The main menu displays fine. To hide the submenus when not hovering, I did

I'm trying to write a ho开发者_开发问答rizontal navigation bar with simple drop down menus (again horz). The main menu displays fine. To hide the submenus when not hovering, I did

ul#submenu {
    visibility: hidden;
    display: inline;
    position: absolute;
    top: 10pt;left: 0;
}

ul#mainmenu li:hover ul#submenu li {
    visibility: visible;
    position: relative;
    float: right;
}

The visibility and appear on hover work fine. However, part of the submenu gets hidden under the float right below. I tried setting z-index: 0 for that and z-index: 1 for the submenus, but it still doesn't work. How do I bring it to the top?


Check if overflow: hidden; or overflow: auto is set in the parent div. That could prevent it from showing up.

0

精彩评论

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