I am assuming you want the site to fill the browser window as opposed to the table in this reply.
I did some scribbling there and came up with this:
<html>
<head>
<style type="text/css">
body {width:100%;
height:100%;
background:white;
}
div {width:100%; margin:none;}
div#title{
height:100px;
min-height:500px;
color:yellow;
background-color:red;
}
div#content{
height:75%;
background-color:yellow;
}
div#footer{
height:50px;
color:white;
background-color:blue;
}
</style>
</head>
<body>
<div id="title">
<h1>Title DIV</h1>
</div>
<div id="content">
<p>Content</p>
<table border="1">
<tr> <td> Medal </td> <td> Gymnast </td> </tr>
<tr> <td> Gold? </td> <td> Paul Hamm! </td> </tr>
</table>
</div>
<div id="footer">
<h7>Footer DIV</h7>
</div>
</body>
</html>
- <html>
- <head>
- <style type="text/css">
- body {width:100%;
- height:100%;
- background:white;
- }
- div {width:100%; margin:none;}
- div#title{
- height:100px;
- min-height:500px;
- color:yellow;
- background-color:red;
- }
- div#content{
- height:75%;
- background-color:yellow;
- }
- div#footer{
- height:50px;
- color:white;
- background-color:blue;
- }
- </style>
- </head>
- <body>
- <div id="title">
- <h1>Title DIV</h1>
- </div>
- <div id="content">
- <p>Content</p>
- <table border="1">
- <tr> <td> Medal </td> <td> Gymnast </td> </tr>
- <tr> <td> Gold? </td> <td> Paul Hamm! </td> </tr>
- </table>
- </div>
-
- <div id="footer">
- <h7>Footer DIV</h7>
- </div>
- </body>
- </html>
Basically this produces a page with three parts - a title, footer and content area. I'm not sure if you have a footer, but it doesn't matter if you do or not.
What you need to do is set the heights of the title area(and footer if you have one) to a pre-set number of pixels, so they are fixed.
However the 'content' div needs to be set to a % of the browser window so it expands. Use the following as a rough guide:
key:
H+F = Combined Height of 'header' and 'footer' in pixels.
C = Height of 'Content' in %.
PH600 = % of 800x600 height filled.
PH768 = % of 1024x768 height filled.
(Rules)
(1) H+F = 50px; C = 91%; PH600=99%; PH768=98%;
(2) H+F = 100px; C = 83%; PH600=100%; PH768=96%;
(3) H+F = 150px; C = 75%; PH600=100%; PH768=95%;
(4) H+F = 200px; C = 66%; PH600=99%; PH768=92%;
(5) H+F = 250px; C = 58%; PH600=100%; PH768=91%;
(6) H+F = 300px; C = 50%; PH600=100%; PH768=89%;
So for the example I inserted at the top, the combined height of my header and footer was 150px, so I set the height of my 'Content' div to 75% per Rule(3) above. This will fill the height of an 800x600 page to 100% of the screen and fill a 1024x768 page to 95% of the screen.
Note, say I didn't want a footer and my header was still 100px high, I would set 'Content' height to 83% (per Rule(2) above). Then 100% of 800x600, and 96% of 1024x768 height would be filled.
As you can see the more space your header and footer take up, the worse this is for the larger resolution. Not perfect but should do your trick. You can play around with the numbers above but I the % I have stated are as far as I know the best which will best satisfy both resolutions at the same time.