Skip to content

Import CSS files using @import in CSS

Find out how to import styles from other stylesheets in CSS. Learn how to import CSS files using @import.

Syntax

@import url [media query]

Examples

@import url(style.css)
@import url('https://poopcode.com/styles/dark.css')

You can also pass a media query along with the import which would load the CSS only on the specific media. Examples of media are all, screen, print.

@import url(style.css) all;
@import url(style-for-screen.css) screen;
@import url(style-for-print.css) print;

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.