Skip to content

Instantly share code, notes, and snippets.

@DanielOberg
Created September 23, 2010 08:49
Show Gist options
  • Save DanielOberg/593353 to your computer and use it in GitHub Desktop.
Save DanielOberg/593353 to your computer and use it in GitHub Desktop.
CSS - 100% height with footer
/**
* Minimal version of:
* http://www.xs4all.nl/~peterned/examples/csslayout1.html
*/
html,body {
margin:0;
padding:0;
height:100%; /* needed for container min-height */
}
div#container {
position:relative; /* needed for footer positioning*/
margin:0 auto;
width:750px;
height:auto !important;
min-height:100%;
}
div#content {
padding:1em 1em 5em; /* bottom padding for footer */
}
div#footer {
position:absolute;
width:100%;
bottom:0; /* stick to bottom */
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment