Div at bottom of window and adaptable height div
Posted
by
Rob
on Stack Overflow
See other posts from Stack Overflow
or by Rob
Published on 2009-08-28T14:28:58Z
Indexed on
2012/10/13
15:38 UTC
Read the original article
Hit count: 236
Is there a way to get a div to always be at the bottom of the window, and another div to change its height to fill any space that it leaves, and that div will scroll if its content is too long. (I never want the window to scroll).
This is best illustrated by a picture:
The green div will always put itself at the bottom of the window, and the orange div will fill the gap. When the window is smaller, like in the right hand image, the orange div will be smaller and will scroll.
The green div can be toggled. Sometimes the green div will have display: none
, and then the orange div will stretch to the bottom. When the green div has display: block
again, it will look like the picture again.
It has to work in IE6.
So far I can get the green div to go to the bottom by:
position: absolute;
bottom: 0;
But I don't know how to get the orange div to do what I want.
© Stack Overflow or respective owner