开发者

Nested lists and z-index

开发者 https://www.devze.com 2023-01-11 22:10 出处:网络
I\'m building a navigation menu for a website and the menu has submenus.When the submenu slides down, it needs t开发者_运维百科o lie behind the main navigation.I\'ve tried using z-index but it won\'t

I'm building a navigation menu for a website and the menu has submenus. When the submenu slides down, it needs t开发者_运维百科o lie behind the main navigation. I've tried using z-index but it won't work. Since the submenu is a child of the LI, is it not able to lie behind?

The code is a bit verbose due to the image sprite, so I'll link to a pastie:

http://pastie.org/1100075

And here's some images to support my explanation.

Desired outcome: http://imgur.com/WeU5T.png

Current outcome: http://imgur.com/0ZC4v.png


Move the li.home a link out side of ul.nav, and put it inside of an absolutely positioned block element with a z-index > 0.

0

精彩评论

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

关注公众号