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

HTML How to Make a Website Styling Web Pages and Navigation Style the Image Captions

Why do the paragraph elements have a margin by default?

I thought this was resolved by the normalize css file.

1 Answer

John Stuifbergen
John Stuifbergen
7,460 Points

Paragraph tags have default margins in order to help the user read content easier and scan for important information.

The purpose of normalize.css is to promote better cross-browser rendering for html element. Font sizes, margins, padding, etc. can be completely different depending on the browser. Normalize is a fix for that and level-sets the appearance of the markup to make styling the rest of your site much easier.

Ah thank you, I misunderstood normalize.css and thought it removed all default margins and padding.

John Stuifbergen
John Stuifbergen
7,460 Points

Ah, I believe you're referring to reset.css. I believe normalize includes reset and then adds its styles to "normalize".