Bootstrap has a class that does what you want: .navbar-fixed-bottom . Using this class is the best solution since you don't need custom css.
However, if you really want to use custom CSS, here's how to do it. Assuming the footer element has a footer ID:
#footer { position: fixed; width: 100%; bottom: 0; }
And you have to make sure that when the user scrolls to the bottom of the page, the footer should not require the lowest content. To avoid this, the easiest solution is to add a bottom margin to the body element in the same size as the footer height. Assuming the footer element is 100px high, you can use this code:
body { margin-bottom: 100px; }
But to make sure that you avoid overlapping the footer, you will need to use jQuery to update the extreme edge of the body when resizing the screen, since the height of the footer may change, especially in flexible layouts.
Mato
source share