View Full Version : scroling div with % based height


neff
08-10-2004, 11:42 AM
I'm attempting a page layout that contains a scrolling div for the main content (overflow: auto;). I want this div to be placed a fixed position from the top of the browser window but to expand vertically to fill up the rest of the window space.

I can get something working in IE6 using an MS expression for the height of the DIV
Example 1 (http://www.fogcat.co.uk/example/example.html)

But obviously this doesn't work on Firefox.

I tried a different method to avoid the expression.
Example 2 (http://www.fogcat.co.uk/example/example5.html)

This one is odd, in that at first site it doesn't look as though it works in IE6... BUT if you re-size the window (even slightly) it then appears how I would expect. However this version still doesn't give a scrolling div in Firefox, it seems the height of 100% given to the div #bottomHalf is over ridden.

Is there actually a way I can achieve what I'm after that will work across the latest browsers? (I'm not worried about IE5, NN4 etc).