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

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
220,696 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
220,696 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.