CSS @import Rules
CSS @import Rules
CSS @import
rule is used to import style rules from other style sheets.
Declaration Rules
The following rules must be followed while declaring @import.
- The
@import
rule must be at the top of the document but after any @charset declaration (if any). - The
@import
rule also supports media queries, so you can allow the import to be media-dependent.
Example
The following is the foo.css style sheet file.
The following is the bar.css style sheet file.
The following is the main.css style sheet file. Here we are going to import foo.css and bar.css style sheet files.
The following is the html file for demonstration.
Syntax
Reminder
Hi Developers, we almost covered 98.7% of CSS Tutorials with examples for quick and easy learning.
We are working to cover every Single Concept in CSS.
Please do google search for:
Join Our Channel
Join our telegram channel to get an instant update on depreciation and new features on HTML, CSS, JavaScript, jQuery, Node.js, PHP and Python.
This channel is primarily useful for Full Stack Web Developer.