1 reply [Last post]
intrepidus
Offline
Regular
Last seen: 14 years 34 weeks ago
Joined: 2004-09-26
Posts: 12
Points: 0

Which one is the proper one to use? @import, <link>, or both? I can't find a site that gives me a straight answer. I only have one style sheet...does <link> make more sense?

Tony
Tony's picture
Offline
Moderator
Brisbane
Last seen: 1 week 4 days ago
Brisbane
Timezone: GMT+10
Joined: 2003-03-12
Posts: 5344
Points: 2965

@import and link

Hi intrepidus,
You can use both or either, but there's a couple of things you should remember.
Firstly many old browsers don't support @import.
Using @import on a page without a link or script tag can cause FOUC, Flash of Unstyled Content.

So I usually use link unless I am trying to hide styles from older browsers.

Hope that helps