views:

42

answers:

1

I have an empty page with one DIV on it:

<div style="height: 20%;
            min-height: 10px;
            max-height: 100px;
            width: 100%;
            background-color: blue;"></div>

I want to add a DIV after this one that takes up all remaining vertical space on the page. How do I do it?

I've spent all day on this and CSS is starting to drive me crazy.

+1  A: 

What has to be inside this div?

If it's a just a color filler, just put your blue div in a another div wich you give a background color and make that one fit 100% of your browser window?

It will look like 2 divs beneath eachother. If you need content you can always just put another div under your blue one with whatever content you want.

EDIT: code example: http://jsbin.com/efefe/2

Rakward
Thanks for the response! The background-colors are just there so you can see the DIVS. What I have is an application where I have a Google Map, and beneath it an elevation profile. So I generally want the map to occupy 80% of the screen (it needs as much screen as possible), and the elevation profile to have 20%. However, as the vertical size of the screen shrinks, the elevation profile must stay visible (min-height), and if someone has a large screen, I don't want the elevation profile to waste space that is better suited for the map (max-height).
Nick
And the way Google Maps works, must have a container div with a height or it shrinks to zero.
Nick