Skip to content

Instantly share code, notes, and snippets.

@maxgfr
Created February 17, 2022 20:16
Show Gist options
  • Save maxgfr/36fba0f64b78e4e7d6b0b4507fb7c163 to your computer and use it in GitHub Desktop.
Save maxgfr/36fba0f64b78e4e7d6b0b4507fb7c163 to your computer and use it in GitHub Desktop.
Sticky footer using flexbox
<body>
<div class="content">
content
</div>
<footer class="footer"></footer>
</body>
html, body {
height: 100%;
}
body {
display: flex;
flex-direction: column;
}
.content {
flex: 1 0 auto;
}
.footer {
flex-shrink: 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment