--- title: '@import' slug: Web/CSS/@import translation_of: Web/CSS/@import ---
{{CSSRef}}

CSS @-kurallarıdan olan @import diğer stil dosyalarından stil kurallarını mevcut sayfamıza dahil etmek için kullanılır. These rules must precede all other types of rules, except {{cssxref("@charset")}} rules; as it is not a nested statement, @import cannot be used inside conditional group at-rules.

@import url("fineprint.css") print;
@import url("bluish.css") projection, tv;
@import 'custom.css';
@import url("chrome://communicator/skin/");
@import "common.css" screen, projection;
@import url('landscape.css') screen and (orientation:landscape);

So that {{glossary("user agent")}}s can avoid retrieving resources for unsupported media types, authors may specify media-dependent @import rules. These conditional imports specify comma-separated media queries after the URL. In the absence of any media query, the import is unconditional. Specifying all for the medium has the same effect.

Syntax

@import url;
@import url list-of-media-queries;

where:

url
Is a {{cssxref("<string>")}} or a {{cssxref("<url>")}} representing the location of the resource to import. The URL may be absolute or relative. Note that the URL need not actually specify a file; it can just specify the package name and part, and the appropriate file is chosen automatically (e.g. chrome://communicator/skin/). See here for more information.
list-of-media-queries
Is a comma-separated list of media queries conditioning the application of the CSS rules defined in the linked URL. If the browser does not support any these queries, it does not load the linked resource.

Formal syntax

{{csssyntax}}

Specifications

Specification Status Comment
{{SpecName('CSS3 Cascade', '#at-ruledef-import', '@import')}} {{Spec2('CSS3 Cascade')}}  
{{SpecName('CSS3 Media Queries', '#media0', '@import')}} {{Spec2('CSS3 Media Queries')}} Extended the syntax to support any media query and not only simple media types.
{{SpecName('CSS2.1', 'cascade.html#at-import', '@import')}} {{Spec2('CSS2.1')}} Added support for {{cssxref("<string>")}} to denote the url of a stylesheet,
and requirement to insert the @import rule at the beginning of the CSS document.
{{SpecName('CSS1', '#the-cascade', '@import')}} {{Spec2('CSS1')}} Initial definition

Browser compatibility

{{CompatibilityTable}}

Feature Chrome Edge Firefox (Gecko) Internet Explorer Opera Safari
Basic support {{CompatVersionUnknown}} {{CompatVersionUnknown}} {{CompatVersionUnknown}} 5.5 {{CompatVersionUnknown}} {{CompatVersionUnknown}}
Feature Android Edge Firefox Mobile (Gecko) IE Mobile Opera Mobile Safari Mobile
Basic support {{CompatVersionUnknown}} {{CompatVersionUnknown}} {{CompatVersionUnknown}} 5.5 {{CompatVersionUnknown}} {{CompatVersionUnknown}}