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

Martin Coutts
Martin Coutts
18,154 Points

How to get footer to stay at bottom of page

I just finished building a fake site but I am having the issue that the content on some of the pages is too little so there is a large white space under the footer. I have tried changing the "bottom" to 0, margin bottom to zero and I can't seem to fix it.

Any ideas? The link is below for the page as well as the git repo

http://martincoutts.com/hotelArtemis/index.html

https://github.com/martincavaliers/hotelArtemis

1 Answer

Steven Parker
Steven Parker
231,248 Points

Looking at your page on my browser (Chrome), I do not see any white space. The black footer touches the bottom edge of the window.

Martin Coutts
Martin Coutts
18,154 Points

On the first page it’s fine but on a few of the other pages it does it

Steven Parker
Steven Parker
231,248 Points

My browser devtools show the footer inside a div that has a 50px bottom margin, which would explain the space but I'm not seeing it like that in the source. Very odd!

But I did notice in the source that the "<!DOCTYPE html>" declaration is missing the exclamation point. Try fixing that and see if it helps.