Reputation: 33
I have three divs aligned vertically and want the middle div to fade in and out with javascript by animating the opacity and setting 'display: none;'. However when I do this it causes the bottom div to move down the page to make room for the middle div.
How can I make the bottom div a constant height below the top div independent of whether the middle div is displayed or not?
Upvotes: 3
Views: 43
Reputation: 80
You'll want to use visibility: hidden;
instead of display: none;
visibility: hidden;
hides an element, but it will still take up the same space as before.
Upvotes: 1