LC
css
Back to Snippets

CSS Sticky Footer

Keep the footer at the bottom of the page with minimal CSS.

csslayoutfooter
css
      html,
body {
  height: 100%;
}

body > footer {
  position: sticky;
  top: 100vh;
}

    

This works without flexbox or grid. The footer naturally sits at the bottom when content is short, and flows normally when content is long.