Created
February 27, 2014 06:52
-
-
Save ZellSnippets/9245585 to your computer and use it in GitHub Desktop.
SCSS: Sticky Footer
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
* { | |
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