Created
March 25, 2015 20:19
-
-
Save ClementParis016/cee22927bb34db5ee3f5 to your computer and use it in GitHub Desktop.
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
<!doctype html> | |
<html> | |
<head></head> | |
<body> | |
<header>...</header> | |
<div>...</div> | |
<footer>...</footer> | |
</body> | |
</html> |
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
html { | |
height: 100%; | |
} | |
body { | |
position: relative; | |
min-height: 100%; | |
padding-bottom: 100px; /* footer's height */ | |
} | |
div::after { /* Or what else is before the footer, clear it */ | |
content: ''; | |
display: table; | |
clear: both; | |
} | |
footer { | |
position: absolute; | |
bottom: 0; | |
left: 0; | |
right: 0; | |
height: 100px; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment