I have a div with default display:none. how do I reserve the height so when the div shows, it does not reshift the elements around it? thanks
+2
A:
Use visibility: hidden
instead of display: none
. Your element won't display, but its dimensions still apply and affect other elements because it's still a part of the page flow.
BoltClock
2010-10-24 05:05:28
+4
A:
Instead of putting display: none;
on your div, put visibility: hidden;
. It will be invisible, but still take up space.
John Calsbeek
2010-10-24 05:05:57
+2
A:
if you can use visiblity hidden property instead of display:none you can achieve what you want.
When you do visibilty:hidden it just make the elements opacity to 0 while the element is still retaining its space.
sushil bharwani
2010-10-24 05:05:58