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 CSS Foundations Getting Started with CSS Adding CSS to a Page

advantages of importing css files

what are the advantages of importing css files ?

4 Answers

Pavle Lucic
Pavle Lucic
10,801 Points

Advantage comes when you have large project (50+ page that needs to style).

You can have modular css files, that import into one main css file (something like cotroller).

Andrew Claytor
Andrew Claytor
6,637 Points

If you are talking about files like normalize.css it is because it helps preserve useful defualts across a multitude of browsers.

not that css files.we @import to get css files from other sources.

Jonathan Grieve
MOD
Jonathan Grieve
Treehouse Moderator 91,253 Points

I don't often use import but I think it's as useful as using link-rel in that it doesn't take up space for browser rendering and of course it keeps your code clean and organised.

I know if you import too many style sheets it can drastically affect the speed of you site (slow it down). Here is a Video by Guil that explains it a bit...around 2 min into the video. Here is another explanation.