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

8px Border Automatically Applied By "user agent stylesheet"

I am mid-way through the Website Design track & have completed most of the html & css modules.

I am encountering an issue whereby the "user agent stylesheet" is applying an 8px margin around the body of my html.

I have linked to a local copy of normalize.css v6.0.0 - github.com/necolas/normalize.css. The only way that I can find to remove this is by explicitly specifying the below in my main.css file:

body { margin: 0; }

Is this the correct method or have I missed a technique somewhere?

1 Answer

Correct - I think all major browsers add 8px of margin by default. Because it's consistent across browsers, normalize has apparently opted to keep it in tact, so if you want to remove it then you will want to do just as you have and add it to your custom stylesheet.

Okay, thank you!