You can use rules from a different stylesheet in your
stylesheet by using the
The general form is either of these:
the URI of the stylesheet you want to import.
If you use an
@import, it must precede
all other rules in the same stylesheet.
The effect of importing another stylesheet is just as if the other stylesheet were copied into yours at that location—with one important difference. Imported rules have a lower priority than your other rules.
For example, suppose your stylesheet contains this at-rule:
Further suppose that your stylesheet has a rule for
paragraphs, with selector
p, and the
basic.css stylesheet also has a rule for
paragraphs, with the same selector. In that case, your
rule will be used.
You may also specify a comma-separated list of media types after the URL part of the rule. In this case, the importation of the other stylesheet would happen only if the content were being rendered in one of the selected media types.
For example, this rule:
@import "speech.css" aural, tv;
would apply only for content rendered by a speech
aural) or television (
For more information, see Section 22.1, “Media types”.