Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

CSS How to Make a Website Styling Web Pages and Navigation Polish the Navigation and Footer

Jure Rožman
Jure Rožman
10,232 Points

Bootstrap footer - flush it to the bottom

I can't flush footer to the bottom of the page. I am using Bootstrap. I googled it, but it is not working. I don't want it to be fixed at bottom. I want to scroll to get to it, but now is right after my page content and not at the bottom.

Andrew Shook
Andrew Shook
31,709 Points

Jure, can you post your html? Or open a Codepen and link it? That should make it easier for others to help you debug the problem.

4 Answers

This is one fix (not sure if twitter bootstrap already has this built in!)

You'll need to give your html and body a height of 100%.

Give you footer absolute positioning, bottom: 0, left:0 and width: 100%.

Then go back to your body and assign a padding bottom that is the same as the height of the footer.

e.g. footer height: 200px, body padding-bottom, 200px

This will create a 'sticky' footer.

Callum King
Callum King
6,470 Points

Does adding the navbar-bottom class not work? For example,

<nav class="navbar navbar-default navbar-bottom" role="navigation">
  <div class="container">
    <h1>Hello World</h1>
  </div>
</nav>

I tried the code from here http://cssreset.com/how-to-keep-footer-at-bottom-of-page-with-css/ The footer goes to the bottom but a part of the footer is not visible on the page, I have to scroll down to see the full footer. Could you let me know how to correct this issue.

Wayne Priestley
Wayne Priestley
19,579 Points

Hi Jure,

This could be caused if you simply don't have enough content on the page to push the footer off the screen.

Add some random content and see if the footer disappears until you scroll down.