Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Flushing footer to bottom of the page, twitter bootstrap

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.

like image 519
Calvin Cheng Avatar asked Apr 11 '12 03:04

Calvin Cheng


People also ask

How do I stick the footer to the bottom of bootstrap 5?

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.

How do I move my footer to the bottom of the screen?

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!


1 Answers

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

like image 159
sanon Avatar answered Sep 27 '22 21:09

sanon