bootstrap sticky footer code example

Example 1: fix-bottom bootstrap

<div class="fixed-bottom">...</div>

Example 2: sticky footer bootstrap 3

<style>
.footer {
   position: fixed;
   left: 0;
   bottom: 0;
   width: 100%;
   background-color: red;
   color: white;
   text-align: center;
}
</style>

Example 3: sticky footer not working bootstrap

/* 2020 - bootstrap 4.5+ 
Note: - The flex-fill utility was included in Bootstrap 4.1 at later release. 
So after that release the extra CSS for flex-fill won't be needed. 
Additionally min-vh-100 is included in newer Bootstrap 4 releases */
<div class="d-flex flex-column min-vh-100">
    <nav>
    </nav>
    <main class="flex-fill">
    </main>
    <footer>
    </footer>
</div>

Tags:

Misc Example