Making a divs max height the height of the browser window

topic posted Mon, February 26, 2007 - 12:09 AM by  Greg
I don't think there's a straight css solution to this. But I could be wrong.

In a web page, I have a div that I want to have a max-height of 100% -- of the available space. Basically, I want it to fill up the screen vertically, but not leave the screen out the bottom -- so no scroll bars ever appear to scroll the ENTIRE page. However, if the content in that div is more than what vertical height is available, I want scroll bars to appear only on that div (overflow: auto;).

A good example of what I'm talking about is Google Calendar: calendar.google.com

Check it out, on say, the Weekly view. A scroll bar DOES appear, but only for that div. You can resize your browser window and the div with the calendar in it will resize accordingly. You never get a normal browser scroll bar....just a scrollbar for that section.

Anyone know how to do this? Links to articles online? I've looked around and couldn't find anything....

Thanks.
posted by:
Greg