.flex { display: flex; flex-direction: column; min-height: 100vh; } .default { width: 100%; padding: 1.5em; } .container { max-width: 865px; margin: 0 auto; display: block; } /* footer needs to fill the remaining vertical screen space. doing it here to keep flex stuff together. */ .footer { flex: 1; } @media screen and (max-width: 768px) { .main { padding: 1.25em; } }