How to @Import CSS in HTML With Five Ways Import CSS URL
This Tutorials guide you, How to @import CSS in HTML, there are a number of ways so you can apply a CSS style to a webpage, including both inline styles or external style sheets.
when you make your website, if you are using an external style sheet therefore which is the best and recommended way to dominate an HTML document, then you need to add more files in the external style sheet one approach is to use @import.
To @import CSS in HTML Documents:-
To use the @import rule in your HTML Documents or HTML File(.html), you would add the following to the of the document:
Import the “navigation-menu.css” style sheet into the current style sheet.
@import url("navigation-menu.css");/* Using a url */
@import"navigation-menu.css";/* Using a string */
The @import CSS rules allow you to import external style sheets into an HTML page or into other CSS documents or either in your documents.
it is easier to manage those file and many types of various style that contains lots of styles into a number of smaller, focused files.
therefore import those file which you need to do to get them all working for your web pages, which easier to import and managed all files in a good manner to display.
therefore, this code would now import this style sheet for the purpose use on this HTML Documents or page and you can manage very well manner all of your styles in that one file.
the downside to importing style sheet these ways is that this method does not allow for parallel downloads
Example: Another Way To @import CSS in HTML Documents
Import the “print_document_style.css” style sheet Only if the media is print:
Import the “mobilestyle.css” style sheet ONLY if the media is the screen and the viewport is maximum of 480 pixels