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 Creating HTML Content Include External CSS

Andrew Poteau
Andrew Poteau
2,819 Points

Normalize.css

Is this type of css file common for web pages? In other words, is it a common practice for front end web developers to clear the default browser settings before adding their own style coding?

5 Answers

Craig Campbell
Craig Campbell
14,428 Points

yes! if you want consistency between browsers (and you do) then you need to force it. the browsers come with "baked-in" styles that are often similar, but definitely not identical.

Andrew Poteau
Andrew Poteau
2,819 Points

Thanks for your response Craig. Is it normally done with a separate file devoted just to this purpose, as opposed to just putting it in with the other css?

Craig Campbell
Craig Campbell
14,428 Points

Hey Andrew,

I it depends on the context. When you build an app, you will likely have just one CSS file (each file requires a new XHR or Fetch request, which takes time). this is one reason we build SPAs (single page apps) now - fewer requests so better user experience.

But, you would probably NOT want it all in one manually-generated file because that's difficult to maintain with so many lines of code (which styles did YOU write vs others, etc.). So if you don't have a build process to pack everything into one final output file, then just load multiple files with multiple link tags. As you go on you'll learn about cool technologies like Webpack that are really cool.

Andrew Poteau
Andrew Poteau
2,819 Points

Thanks Craig, I appreciate your responses!

I was going to ask the same question, what about if I'm using a framework like Bootstrap would they have an equivalent as part of their CSS or should I include both?

Craig Campbell
Craig Campbell
14,428 Points

Luke: short answer: you probably don't need it. I'm no Bootstrap expert ( I do my own CSS rather than rely on the bootstrap framework) but from Stack Overflow, I gather you don't need to include a reset like normalize.css if using Bootstrap: http://stackoverflow.com/questions/18286189/should-i-use-normalize-css-in-my-bootstrap-project