Last active
September 19, 2018 09:05
-
-
Save shiftgeist/2b19d487dc2d783147cd06ba87b30d0c to your computer and use it in GitHub Desktop.
footer-at-bottom: Footer at min 100% height bottom
This file contains hidden or 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
<body> | |
<header></header> | |
<main>No matter what length</main> | |
<footer>the footer will still be at the bottom or below #internetthesedays</footer> | |
</body> |
This file contains hidden or 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
body { | |
display: flex; //give the body flex | |
flex-direction: column; //reset flex to "normal" html | |
min-height: 100vh; //minimum of 100% height (browser output window) | |
} | |
footer { | |
margin-top: auto; //set footer to bottom or below main, when larger than 100% height | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment