A Sixth Way to Keep Footers at the Bottom
When someone says "sticky footer" today, they generally mean a footer held in place with position: sticky while some parent element scrolls. But the sticky footer pattern predates that property and means something a little different: the footer stays at the bottom of the screen even when page content is too short to push it there, yet gets pushed down normally once there is enough content. CSS-Tricks previously documented five approaches, including calc(), flexbox, and CSS Grid.
Rosa's contribution
Reader Sílvio Rosa wrote in with a sixth:
html, body { height: 100%;}
body > footer {
position: sticky;
top: 100vh;
}
The appeal here is that no extra wrapper is needed around the non-footer content. The technique is also a bit counterintuitive: top: 100vh; appears to shove the footer out of the viewable area, but that happens regardless of the footer's size — no magic numbers required — and sticky positioning then "sucks it back up" to the bottom edge. The footer never overlaps content, so it is still pushed below the content when the page is long enough, which is central to the sticky footer pattern. It is probably easiest to check on a medium-sized desktop screen, where sticky footers matter most anyway.



