I want a page that has a max-width and a footer, and set the margins gray to set out the main part of the page if the window is bigger than the max-width. Also, I have a fixed footer at the bottom.
I set the background color gray, then the color of the main content white, and set up the margins, which works except when the height of the main divs don't take up all the space to the footer, then I get a big block of gray in this unused area.
The goal is gray margins for space beyond 1024px, all the way down to the footer, irrespective if the main divs take up all the space or not.
Here is what I have:
<style>
body {
background-color: gray;
max-width:800px;
margin: 0 auto;
}
#main {
background-color: white;
}
#footer {
text-align: center;
max-width: 800px;
background-color: white;
position: fixed;
bottom: 0px;
width: 100%;
margin: 0 auto;
}
</style>
<div id='main'>
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec mattis tortor a nisl rhoncus, vitae aliquet lectus sodales.
</div>
<div id="footer">Footer Goes Here</div>
Which gives this. You can see the gray between the #main and #footer
Any suggestions?