Created
July 19, 2020 19:20
-
-
Save heytulsiprasad/a2e4de1444e95929058a3454ccf6fccc to your computer and use it in GitHub Desktop.
Keep navbar and footer fixed at their position (irrespective of content)
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
.Home { | |
display: flex; | |
min-height: 100vh; | |
flex-direction: column; | |
} | |
.HomeContent { | |
flex-grow: 1; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This is a very helpful snippet! Especially when there's no content in your body and you just want the navbar and footer to stick to their places even though there's no content in between them.
.Home
is the parent class.HomeContent
is the child class like the body which can expand accordingly