Ask any question about Bootstrap here... and get an instant response.
Post this Question & Answer:
How can I create a sticky footer with Bootstrap 5?
Asked on Apr 30, 2026
Answer
To create a sticky footer using Bootstrap 5, you can utilize the `flexbox` utilities provided by Bootstrap. This involves setting up a flex container that takes up the full height of the viewport and positioning the footer at the bottom.
<!-- BEGIN COPY / PASTE -->
<div class="d-flex flex-column min-vh-100">
<header class="bg-primary text-white p-3">
Header
</header>
<main class="flex-fill">
Main content goes here.
</main>
<footer class="bg-dark text-white text-center p-3 mt-auto">
Sticky Footer
</footer>
</div>
<!-- END COPY / PASTE -->Additional Comment:
- The outer `` uses `d-flex` and `flex-column` to create a vertical flexbox layout.✅ Answered with Bootstrap 5 best practices.
- `min-vh-100` ensures the container takes at least the full height of the viewport.
- `flex-fill` on the `
` section allows it to expand and fill the available space. - `mt-auto` on the `
- You can customize the colors and padding as needed using Bootstrap's utility classes.
Recommended Links:
