Alex Coplan
Alex Coplan

Reputation: 13361

How to make this dropdown appear above the text below it

I've got a div which has another div drop down below it, but the drop-down appears below the content that's below it, and I want it to appear above it.

I've tried using z-index by setting a lower z-index for the content than the drop-down, but it's not working.

How can I make these divs appear in the correct order? - I've made a mockup of it on a jsfiddle.

Upvotes: 0

Views: 3873

Answers (2)

mikos
mikos

Reputation: 424

I updated your jsfiddle: http://jsfiddle.net/mvRYR/1/

You need to set position: relative; or position: absolute; when using z-index.

Upvotes: 2

balexandre
balexandre

Reputation: 75073

just add

z-index: 10; position: relative;

to your #drop style

if you add background-color: yellow; as well, you could see it better...

Upvotes: 1

Related Questions