CSS Attributes Index Pseudo-class Attributes
Specifies a stylesheet to import.
HTML |
@import url( sUrl ) |
Script |
N/A |
sUrl |
String specifying the URL referencing a cascading style sheet. |
Using the @import rule differs from using the LINK object in that the @import statement is used as part of a stylesheet definition inside a LINK or a STYLE tag. In the scripting model, this means that the owningElement property of the styleSheet object that represents a stylesheet defined through @import will be either a STYLE or a LINK object.
The @import rule should occur at the start of a stylesheet, before any declarations. While Microsoft® Internet Explorer® 4.0 allows @import statements to be anywhere within the stylesheet definition, the rules contained within the @import stylesheet will be applied to the document before any other rules defined for the containing stylesheet, affecting expected rendering.
Rules in the stylesheet override rules in the imported stylesheet.
The following example imports a stylesheet located at "http://anotherStyleSheet.css".
<style type="css/text">
@import url( "http://anotherStyleSheet.css" )
P {color:blue}
</style>
imports, LINK, style, styleSheet