Skip to content

Instantly share code, notes, and snippets.

@ThomasKientz
Last active October 1, 2020 12:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ThomasKientz/3daf0807cb20e0809959bee8075e7fea to your computer and use it in GitHub Desktop.
Save ThomasKientz/3daf0807cb20e0809959bee8075e7fea to your computer and use it in GitHub Desktop.
A stacked layout using flex with a fixed header, a scrollable content and a fixed footer.
<!DOCTYPE html>
<html lang="en">
<body style="margin: 0">
<div style="min-height: 100vh; display: flex; flex-direction: column">
<div style="background-color: darkcyan">Header</div>
<div style="flex: 1 1 0px; overflow: auto">
<div style="height: 20000px">Scrollable content</div>
</div>
<div style="background-color: red">Footer</div>
</div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment