![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
|
I'd like to find a way to stack two divs vertically, where the top div is a fixed height and the bottom dynamic in order to fill the remaining page height. I know this can be done by using position:absolute and using hidden divs to pad things out, but there must be a cleaner approach to this problem out there. |
#2
| |||
| |||
|
|
On 2008-02-12, Lypheus <lypheus (AT) gmail (DOT) com> wrote: I'd like to find a way to stack two divs vertically, where the top div is a fixed height and the bottom dynamic in order to fill the remaining page height. I know this can be done by using position:absolute and using hidden divs to pad things out, but there must be a cleaner approach to this problem out there. You do need position: absolute (unless you use a table), but you don't need hidden divs or z-index. html, body { height: 100%; margin: 0; padding: 0; } body { position: relative } #header { height: 96px; background-color: pink } #content { background-color: palegreen; position: absolute; top: 96px; bottom: 0; left: 0; right: 0; } ... body div id="header">Header</div div id="content">Content</div /body |
![]() |
| Thread Tools | |
| Display Modes | |
| |