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 Use ID Selectors

whats the purpose of normalise.css if we are creating a new css file

Why do we need normalise.css?

5 Answers

Jeff Lemay
Jeff Lemay
14,268 Points

Browsers all have different default styles. So without a normalize file, your site could look different in Chrome, Firefox, IE, etc.

Normalize puts all browsers on a level playing field. Maybe in Chrome the default margin for an h1 is 20px but in Firefox the default margin is 10px. With our normalize file, we've made sure that by default all our h1's have a margin of 20px or 10px or 15px.

Yeah, we might set our h1 margin to something different in our style.css file which will override the properties in normalize.css, but we've at least started with the same foundation.

the purpose of normalise css is to create a foundation for your css file ,it has to be above your css file so as to deal with the cascading nature of css.

Wouter Janson
Wouter Janson
1,545 Points

it's a css reset, webbrowsers have their own default stylesheet. So a css reset makes a webpage look the same in every browser, because these default styles are overwritten.

normalize.css makes sure that all browsers are treating your page in the same manner without adding in their own "formatting" once you've normalized these settings you create another .css file to tell your browser exactly how you want your page to be viewed.

In short, normalize.css gives us a clean slate to work with, where as our custom.css file lays the ground work

Thanks a lot guys for your help