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

0 values

Hi,

What is the point in writing 0 values? for example in this video, he uses in the body properties : margin: 0 .

My question is what's the point, and is there a difference if you don't right anything at all for that property?

thanks

1 Answer

Hey Raphael,

this is done in order to overwrite the default values of the browser that are specified in the browser's User Agent Stylesheet. In most browsers the body has a margin by default and with

body {
  margin: 0;
}

you're overwriting this. This helps to have a consistent experience in most browsers because different browsers might have different default values and in this case a different default margin. Files like normalize.css help you doing that as well by resetting many of the browser's default styles. However you don't have to do this but you have to note that you might get different results depending on the browser you're viewing your website in.