Skip to content

Instantly share code, notes, and snippets.

@heytulsiprasad
Created July 19, 2020 19:20
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save heytulsiprasad/a2e4de1444e95929058a3454ccf6fccc to your computer and use it in GitHub Desktop.
Save heytulsiprasad/a2e4de1444e95929058a3454ccf6fccc to your computer and use it in GitHub Desktop.
Keep navbar and footer fixed at their position (irrespective of content)
.Home {
display: flex;
min-height: 100vh;
flex-direction: column;
}
.HomeContent {
flex-grow: 1;
}
@heytulsiprasad
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment