It is so pleasant to work with experts. Check out this page to find out more regarding tucson criminal lawyer.

Author Topic: When to use CSS @import and when the link tag  (Read 95104 times)

December 12, 2007, 11:47:43 AM
  • Administrator
  • Full Member
  • *****
  • Posts: 7
    • View Profile
    • http://www.ossoba.com

I found out about the CSS @import declaration when I saw it used to import the main stylesheet of the page:
Code: [Select]
<style type="text/css">
@import url("main.css");
</style>

This raised the question of when should you use the link tag:
Code: [Select]
<link rel="stylesheet" type="text/css" href="..." media="screen" />and when the @import technique.

After a quick search in Google (plenty of info on the subject) I found out that using @import from the HTML directly was used in the days of yore to apply different styles for different browsers. Now a days this use is kind of irrelevant.

@import's original purpose is to modularize CSS styles (a good article on the subject) and it is better to use it like that and not to import the main style sheet. For the main / master stylesheet of the page one should use the link tag.


Ossoba Design Studio

When to use CSS @import and when the link tag
« on: December 12, 2007, 11:47:43 AM »
Find all the info that you need about " website redesign mediagiantdesign " at https://www.mediagiantdesign.com