Q:

How to make a div fill the remaning vertical space using css

I am attempting to make a standard website layout with a header, a navigation bar a body (on the right of the navigation bar) and a footer. 
Now I have so far done this:
<! DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <title>Test</title>
        <meta http-equiv="content-type" content="text/html; charset=utf-8" />
        <style type="text/css" media="screen">

            .header {
                float: top;
                width: 100%;
                height: 75px;
            }

            .navbar {
                float: left;
                width: 20%;
                height: 100%;
                height: 100%;
                min-height:100%;
                overflow: scroll;
            }

            .body {
                float: right;
                width: 80%;
                height: 100%;
                min-height:100%;
                overflow: scroll;
            }
            .footer {
                float: bottom;
                width: 100%;
            }
        </style>
    </head>
    <body>
        <div class="header"> Header </div>
        <div class="navbar"> Nav Bar </div>
        <div class="body"> Body </div>
        <div class="footer"> Footer</div>
    </body>
</html>

which produces this:

Now if we check the CSS:
.navbar {

    float: left;
    width: 20%;
    height: 100%;
    min-height: 100%;
    overflow: scroll;
}

.body {
    float: right;
    width: 80%;
    height: 100%;
    min-height: 100%;
    overflow: scroll;
}

As you can see I have tried to set the height and min-height of both the body and nav bar to fill the remaining vertical space i.e:

Yet it doesnt affect it.  However if I do height: 500px it resizes like expected (of course this now wont be very good practice as different screen sizes etc would show a different portion or view of the page):

So basically I am asking how would I be able to make the divs fill the vertical space that's left over without using some hard-coded value i.e 100px rather I would want to do it in percentages thus the page will look the same on all browsers

A:

add this code to your body,html:
body,html{
  height:100%;
}

and make your navbar <div id="navbar"> instead of <div class="navbar">
then add height: 100%; to your navbar
#navbar{
  height:100%
// rest of your code
}

Same to your content
call it something like content, because body is already used. 
#content{
  height:100%
// rest of your code
}

now all the divs will have a height of 100% so the full browser height. 
EDIT: your full code would look like this:
<! DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <title>Test</title>
        <meta http-equiv="content-type" content="text/html; charset=utf-8" />
        <style type="text/css" media="screen">

            html, body{
                padding: 0;
                margin: 0 auto;
                height: 100%;
            }

            #header {
                width: 100%;
                height: 75px;
            }

            #navbar {
                float: left;
                width: 20%;
                height: 100%;
                min-height:100%;
                overflow: scroll;
            }

            #content {
                float: right;
                width: 80%;
                height: 100%;
                min-height:100%;
                overflow: scroll;
            }
            #footer {
                width: 100%;
            }
        </style>
    </head>
    <body>
        <div id="header"> Header </div>
        <div id="navbar"> Nav Bar </div>
        <div id="content"> Body </div>
        <div id="footer"> Footer</div>
    </body>
</html>

