Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CSS - difference between <link etc. and @import 1

Status
Not open for further replies.
@import is only supported by Mozilla 1+, Nescape 6+, IE5+, (not sure about opera was buggy in 3.6).

Import statements are used for more complex organisational structures such as huge web sites where you would have one person taking care of one part of the site and someone else another. You would have a core stylesheet and the import statement would be used to cascade extra style on the pages in the category.

If you simply want to add a stylesheet from another web site you use either one it doesn't matter. import does have a bug in some version of IE where the style sheet would only be considered after it is downloaded so if you use it make sure it has plenty of time to load before the body appears (you can ensure this just by putting an empty script tag right after the css tag with the import).

<style>
@import url(blabla.css);
</style>
<script></script>

I hope this helps. Gary Haran
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top