Update: I have revised my example to align with the updated question you provided.
Below is a functional demonstration of your layout, successfully tested in IE8, IE7, Firefox, and Chrome.
The critical aspect here is to avoid setting the height of the middle
section to 100%. Instead, it should be positioned absolutely, with the top
and bottom
dimensions matching the height of your header
and btm
elements (which, in this scenario, would be 120px).
If the height of the middle
element is set to 100%, it will match the height of the big
element (which spans 100% of the body tag), resulting in an oversized middle
segment that could trigger lateral scroll bars.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
<style type="text/css">
html
{
height: 100%;
}
body
{
background-color: #EEEEEE;
height: 100%;
padding: 0;
margin: 0;
}
#big
{
width: 100%;
height: 100%;
}
#header
{
width: 100%;
background-color: #DDD;
height: 120px;
}
#btm
{
width: 100%;
height: 120px;
position: absolute;
bottom: 0px;
background-color: #999;
}
#middle
{
width: 100%;
position: absolute;
top: 120px;
bottom: 120px;
}
</style>
</head>
<body>
<div id="big">
<div id="header">
header
</div>
<div id="middle">
middle
</div>
<div id="btm">
bottom
</div>
</div>
</body>
</html>