Div height 100% excluding header
You can use box-sizing
property for this
Check this:
http://jsfiddle.net/Gn8zN/1/
Another simple & best solution
Check this:
http://jsfiddle.net/B8J2H/
Here is an article about this problem. CSS 100% height problem
You can see the example page has a perfect 100% layout what header and footer. It uses relative position and not absolute.
This should work:
http://jsfiddle.net/94JNZ/1/
#content
{
height: auto;
width: 100%;
position: absolute;
top: 40px;
bottom: 0;
}