Reputation: 1
I have added a dropdown menu to my current menu.
But the problem is that the dropdown part stays behind the content.
How do I resolve this, rather than making the position absolute and fixed manual measures?
Thanks
Upvotes: 0
Views: 17757
Reputation: 749
You can set the z-index
of the dropdown
menu to a higher value
For example:
#menu {
z-index: 1;
}
#dopdown {
z-index: 2;
}
UPDATE:
You might wanna set the z-index
of the other elements in the menu to 1
too.
Upvotes: 2
Reputation: 360
try to set z-index of your dropdown container more than that of content.
<div style="z-index:1;">
Content div
</div>
<div style="z-index:2">
your dropdown content
</div>
just set your css and html as you need , whatever your question is , will be solved with z-index property.
Upvotes: 0
Reputation: 857
Check out the following links :
https://stackoverflow.com/a/21394831/1127263
http://www.cssterm.com/css-menus/horizontal-css-menu/simple-drop-down-menu
http://www.simonbattersby.com/blog/css-horizontal-menu-with-dropdowns/#
Upvotes: 0