views:

21

answers:

1

I'm building a navigation menu for a website and the menu has submenus. When the submenu slides down, it needs to 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

A: 

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.

Jesse Dhillon
I'm not sure how this would help me while still maintaining the functionality of a submenu. The submenu needs to be visible when the main LI is hovered, so, to make that work, the submenu still needs to be contained within the main LI, which I think is where the problem lies.
Bradley Herman
Are you using Javascript to show/hide the submenu? If so, I don't see why the actual markup is an issue.
Jesse Dhillon