Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

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>
B2B Design and Development
B2B Design and Development
1,680 Points

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,567 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.