Skip to content

Instantly share code, notes, and snippets.

@ZellSnippets
Created February 27, 2014 06:52
Show Gist options
  • Save ZellSnippets/9245585 to your computer and use it in GitHub Desktop.
Save ZellSnippets/9245585 to your computer and use it in GitHub Desktop.
SCSS: Sticky Footer
* {
margin: 0;
}
html, body {
height: 100%;
}
.page-wrap {
min-height: 100%;
/* equal to footer height */
margin-bottom: -142px;
}
.page-wrap:after {
content: "";
display: block;
}
.site-footer, .page-wrap:after {
/* .push must be the same height as footer */
height: 142px;
}
.site-footer {
background: orange;
}
// Note: For this, there must be only 2 major elements within body. -- .page-wrap and .site-footer.
// All other content goes within page-wrap.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment