I am designing a master page. The layout is very simple.But height adjustment does not work for me. The layout is:
<html>
<head>
</head>
<body>
<div id='container'>
<div id='top'></div>
<div id='middle'></div>
<div id='bottom'></div>
</div>
</body>
</html>
What I want to achieve is
- ‘Container’ minimum height should be 100% and it should expand when the content is more than the height.
- height of the ‘top’ div should be 100px – fixed height.
- height of the ‘bottom’ should be 50px – fixed height and
- the remaining height(space) should be distributed to ‘middle’ div.
In short, whatever the height of the screen is header should be at the top with fixed height and footer should be at the bottom with fixed height. When the content exceeds the height of the ‘middle’ div then it should expand only with browser scrool bar without additional scroll bar.
I used the following css but it does not work.
html, body {width:99%; height:98%; font-family: "Trebuchet MS", Verdana, Helvetica, Sans-Serif; font-size:12px;}
#container {width:990px; height:100%; margin:0px auto 0px auto;}
#top {width:990px; height:100px;}
#middle {width:990px; min-height:100%; border:1px solid #336699; overflow:auto}
#bottom {width:990px; height:50px;}
Note: I am going to use this in ASP.NET MVC pages.
Try this: