Flexbox Sticky Footer Full Height
Create a sticky footer layout using flexbox with a column direction and auto margin on the main content area.
Code
.page {
display: flex;
flex-direction: column;
min-height: 100vh;
}
.page-header { flex: 0 0 auto; }
.page-main { flex: 1 1 auto; }
.page-footer { flex: 0 0 auto; }
@media (min-width: 768px) {
.page-main { max-width: 960px; margin: 0 auto; }
}Report a problem with this exampleOpens a pre-filled issue on GitHub.