I am generally familiar with the technique of flushing a footer using css.
But I am having some trouble getting this approach to work for Twitter bootstrap, most likely due to the fact that Twitter bootstrap is responsive in nature. Using Twitter bootstrap I am not able to get the footer to flush to the bottom of the page using the approach described in the above blog post.
Keep the footer at the bottom by using Bootstrap 5Make sure that you are wrapping everything but the footer element in a <div> or any other block-level element. Make sure that you using <footer> or any other block-level element to wrap the footer.
Just wrap your . container and your . footer in a flex container with a min-height: 100vh, switch the direction to column so that they stack on top of each other, and justify the content with space between so that footer will move to the bottom. This is THE way to go!
This is now included with Bootstrap 2.2.1.
Bootstrap 3.x
Use the navbar component and add .navbar-fixed-bottom
class:
<div class="navbar navbar-fixed-bottom"></div>
Bootstrap 4.x
<div class="navbar fixed-bottom"></div>
Don't forget to add body { padding-bottom: 70px; }
or otherwise the page content may be covered.
Docs: http://getbootstrap.com/components/#navbar-fixed-bottom
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With