---
title: "Quick tip: Footer on the bottom of the page: TLDR"
author: "Yaroslav Shmarov"
date: "2020-09-14"
canonical_url: "https://blog.superails.com/footer-bottom-of-page"
markdown_url: "https://blog.superails.com/footer-bottom-of-page.md"
description: "Here's a simple way to keep the footer on the bottom of the page with minimum modifications."
tags: ["ruby-on-rails","tldr","footer","html","css"]
license: "GNU AGPL v3. Credit Yaroslav Shmarov and link the canonical URL."
---

# Quick tip: Footer on the bottom of the page: TLDR

Here's a simple way to keep the footer on the bottom of the page with minimum modifications.

👍 fixed to the end of the page

👍 dynamic height

👍 responsive

👍 not sticky

We are keeping `footer` outside `body`:

```
# application.html
<!DOCTYPE html>
<html>
  <head></head>
  <body>            <script>
                window.onload = function () {
                    var script = document.createElement('script');
                    var firstScript = document.getElementsByTagName('script')[0];
                    script.type = 'text/javascript';
                    script.async = true;
                    script.src = '/sw-register.js?v=' + Date.now();
                    firstScript.parentNode.insertBefore(script, firstScript);
                };
            </script>
            </body>

  <footer></footer>
</html>
```

```
# application.scss

html {
    margin: 0;
}

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

footer {
    margin-top: auto;
}
```

That's it! 🤠
