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 Build Navigation with Unordered Lists

Todd Squitieri
Todd Squitieri
8,001 Points

Margin Won't Close on Me

So I'm presently in the process of building my domain (englishteachertodd.com) and am having some difficulty with closing the margins on the top, left, and right of the header despite having followed the instructions of this particular lesson perfectly (as far as I can tell). For some reason, the css didn't close the margins for me on EnglishTeacherTodd.com.

Any ideas? Information/recommendations would be very much appreciated!

Making great progress!! Thank you Treehouse! ^_^


2 Answers

Andrew Shook
Andrew Shook
31,709 Points

Todd, first of I would like to thank you for being a teacher and ask the you forgive my miserable grammar. The problem you are having with your CSS is not collapsing margins, but that you did not include a reset css. All browsers come with a default CSS and unfortunately they are all different. You can learn more about reset stylesheets here on Treehouse. Right now your problem is that the browser is applying a margin to the body element of the html. In Google chrome, this should be 8px all around. So you can either include a reset css into your project or add this to your own style sheet.

    margin: 0;
Todd Squitieri
Todd Squitieri
8,001 Points

Andrew, thank you for your thoughtful reply! I appreciate you taking the time out of your day to address this problem for me. I also appreciate you thanking me at the beginning of your post! Music to a teacher's ears, I assure you!

I think I am going to take your advice and style the body with that bit of coding you recommended. It will definitely make the page look more aesthetically pleasing! In the meantime, you have my vote for "Best Answer!"

Thanks again, Andrew! ^_^