Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

HTML How to Make a Website Creating HTML Content Include External CSS

hamza shaikh
hamza shaikh
5,875 Points

why to add normalize css file? and what is it?

ok i'm just curious that why we have to add this file in our folder. what does it really do?. does this file enable me to add css? and i can't add css without this file? i will really appreciate if you clear this up for me. thank you in advance

4 Answers

Every web browser has a default styling for all html element different from browser to browser.So if you want to create your own styling in a webpage without any conflicts from the default styling, you must reset your styling with normalize.css or reset.css for example, and after that adding your own css.

hamza shaikh
hamza shaikh
5,875 Points

thank you for your help. i get it now

Isaac Asante
Isaac Asante
4,752 Points

To add to John's explanation, your custom CSS file should be placed AFTER the normalize.css file in your site's header in order for your changes to reflect. This is all because of the cascading nature of CSS. If you place normalize.css in your header after your custom CSS file, your changes will be overwritten for all elements selected in the normalize file.

Very good Isaac thank you.

Hey Hamza,

Normalize.css basically levels the playing field for all browsers. For instance, Google Chrome might add more padding to elements than Internet Explorer, so normalise.css just makes all browsers that include this file all have the same content, margins, spacing etc.

Hope this helps

John /n/n

Well done John.

So then, is normalize.css always going to be the same file (as far as content goes)? Or are there plausible situations in which i would have to re-create it from scratch for a given project (for optimization purposes perhaps)?

Isaac Asante
Isaac Asante
4,752 Points

No, normalize.css levels the playground for all browsers... So it doesn't matter whatever type or design you're aiming. Any specific CSS changes or details should be included in your custom CSS file. To answer your question, you don't ever need a new normalize.css