Skip to content

Instantly share code, notes, and snippets.

@stanosmith
Created April 9, 2012 22:22
Show Gist options
  • Save stanosmith/2347043 to your computer and use it in GitHub Desktop.
Save stanosmith/2347043 to your computer and use it in GitHub Desktop.
CSS: Sticky Footer
html, body {
height: 100%;
}
#container {
min-height: 100%;
}
#main {
overflow: auto;
padding-bottom: 150px; /* must be same height as the footer */
}
#footer {
position: relative;
margin-top: -150px; /* negative value of footer height */
height: 150px;
clear: both;
}
/*Opera Fix*/
body:before {
content: "";
height: 100%;
float: left;
width: 0;
margin-top: -32767px;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment