user3445866
user3445866

Reputation: 1

How to make a dropdown menu appear on top of another div

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

Answers (3)

Explisam
Explisam

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

Eshant Sahu
Eshant Sahu

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

Related Questions