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!

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 Basics (2014) Getting Started with CSS Importing Style Sheets with @import

What will be faster @import or link?

I would like to add normalize.css and some css fonts before my main css style, so what is the best solution for this? Linking files with link tag in html or using @import in css?

3 Answers

link is preferred in all cases over @import, because @import blocks parallel downloads, meaning that the browser will wait for the imported file to finish downloading before it starts downloading the rest of the content.

Sergey Podgornyy
Sergey Podgornyy
20,660 Points

In theory, the only difference between them is that @import is the CSS mechanism to include a style sheet and


the HTML mechanism. However, browsers handle them differently, giving


a clear advantage in terms of performance.

Steve Souders wrote an extensive blog post comparing the impact of both


and @import (and all sorts of combinations of them) called "donโ€™t use @import". That title pretty much speaks for itself.

Yahoo! also mentions it as one of their performance best practices (co-authored by Steve Souders): [Choose

``` over `@import`](https://developer.yahoo.com/performance/rules.html#csslink=).

Also, using the 


 tag allows you to define ["preferred" and alternate stylesheets](http://alistapart.com/article/alternate). You can't do that with `@import`.

Thank you very much for your answers, Jackson and Sergey. Now it's clear for me! :)