son Posted May 15, 2009 Share Posted May 15, 2009 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 More sharing options...
chibineku Posted May 15, 2009 Share Posted May 15, 2009 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 More sharing options...
son Posted May 18, 2009 Author Share Posted May 18, 2009 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 More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.