I am generally familiar with the technique of flushing a footer using css and this following approach.
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.
This is now included with Bootstrap 2.2.1.
Bootstrap 3.x
Use the navbar component and add
.navbar-fixed-bottom
class:Bootstrap 4.x
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
to handle width constraint layouts use the following so that you do not get rounded corners, and so that your nav bar will be flush to the sides of the application
then you can use css to override the bootstrap classes to adjust height, font, and color
Tested with
Bootstrap 3.6.6
.HTML
CSS
Found the snippets here works really well for bootstrap
Html:
CSS:
Source: Demo and Tutorial (no longer available; RIP)
The simplest technique is probably to use Bootstrap
navbar-static-bottom
in conjunction with setting the main container div withheight: 100vh
(new CSS3 view port percentage). This will flush the footer to the bottom.Keep it simple.
You may need to also offset the height of the footer by adding a
margin-bottom
equivalent to the footer height to thebody
.