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 CSS: Cascading Style Sheets Take a Mobile-First Approach

is margin necessary

if margin is set to "0". it doesn't appear to have any effect. is it necessary to include it in the css file.

1 Answer

Jesus Mendoza
Jesus Mendoza
23,288 Points

Is not necessary, HTML has a margin and padding predetermined for each tag, if you want all to be 0 you have to set it

* {
   margin: 0;
   padding: 0;
}

After that you can add your own margins and paddings to the containers you want

Jonthue Michel
Jonthue Michel
1,462 Points

If HTML has margin & padding predetermined for each tag, than why brother to do it in CSS?