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 trialhamza shaikh
5,875 Pointswhy 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
John Leskas
24,093 PointsEvery 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.
Isaac Asante
4,752 PointsTo 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.
John Leskas
24,093 PointsVery good Isaac thank you.
John MacDonald
8,593 PointsHey 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
John Leskas
24,093 PointsWell done John.
Unsubscribed User
7,381 PointsSo 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
4,752 PointsNo, 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
hamza shaikh
5,875 Pointshamza shaikh
5,875 Pointsthank you for your help. i get it now