asp.net.ph

Skip Navigation Links

@import At-Rule


Specifies a stylesheet to import.

Syntax

@import url | layer | supports | media query;

Possible Values

url String specifying the URL referencing a cascading style sheet.
layer Name of a cascade layer into which the contents of the linked resource are imported.
supports Indicates the feature(s) that the browser must support in order for the stylesheet to be imported.
media query A comma-separated list of media queries, which specify the media-dependent conditions for applying the CSS rules defined in the linked URL.

Remarks

The @import at-rule is used to import style rules from other valid stylesheets.

An @import rule must be defined at the top of the stylesheet, before any other at-rule ( except @charset and @layer ) and style declarations, or it will be ignored.

Rules in the stylesheet override rules in the imported stylesheet.

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.

Example

The following example imports a stylesheet located at http://anotherStyleSheet.css.

<style type="css/text">
   @import url( "http://anotherStyleSheet.css" )
</style>
See Also

link   style


Need a break ?
Suggested Reading

Check out related books at Amazon

© 2025 Reynald Nuñez and asp.net.ph.

If you have any question, comment or suggestion,
please send us a note