Ask any question about Bootstrap here... and get an instant response.
Post this Question & Answer:
How can I use Bootstrap to create a sticky footer that always stays at the bottom of the viewport?
Asked on Jan 23, 2026
Answer
To create a sticky footer using Bootstrap 5, you can use the utility classes to ensure the footer stays at the bottom of the viewport. Here's a simple example:
<!-- BEGIN COPY / PASTE -->
<div class="d-flex flex-column min-vh-100">
<main class="flex-fill">
<!-- Main content goes here -->
</main>
<footer class="bg-dark text-white-50 text-center py-3 mt-auto">
Sticky Footer Content
</footer>
</div>
<!-- END COPY / PASTE -->Additional Comment:
✅ Answered with Bootstrap 5 best practices.- The `d-flex flex-column min-vh-100` classes on the container ensure that it takes the full height of the viewport.
- The `flex-fill` class on the main content allows it to expand and fill the available space.
- The `mt-auto` class on the footer pushes it to the bottom of the container.
- Adjust the footer styling as needed with Bootstrap's utility classes for background and text color.
Recommended Links:
