Jump to content

Display Div On Top Of Other Content


son

Recommended Posts

I have a heading that serves as a link to show/hide a div. I would like to display the content of the div above all other content on web page and tried to assign a z-index of 2. It does not work. Opening the div pushes all other content down. How would you do it otherwise?Son

Link to comment
Share on other sites

It helps that it's a header, because you can use position: absolute to precisely position the div. Absolute positioning takes the div out of the flow of the page so it won't care where other elements are. Or you can use position: relative and set the top property to a minus value, whatever is needed to make it sit squarely over the div you want it to hide.

Link to comment
Share on other sites

It helps that it's a header, because you can use position: absolute to precisely position the div. Absolute positioning takes the div out of the flow of the page so it won't care where other elements are. Or you can use position: relative and set the top property to a minus value, whatever is needed to make it sit squarely over the div you want it to hide.
Thanks for your input...Son
Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...