how reserve height while display is none

Viewed 8200

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

4 Answers

Or if you are playing with jQuery fadeIn/fadeOut and need that spot to remain empty but with reserved height, then just wrap around needed element with fixed height, for example:

<div style="height: 52px;">
     <img id="loader" src="loader.gif />
</div>
Related