Get the App
SLTechnology News&Howtos  ›  Development  › 

How to use @ import to introduce CSS files

Shulou Source: shulou.com Published: 2022-06-01 06:12:47 10月02日 Update

In this article, the editor introduces in detail "how to use @ import to introduce CSS file", the content is detailed, the steps are clear, and the details are handled properly. I hope this "how to use @ import to introduce CSS file" article can help you solve your doubts.

@ import url (url) sMedia

Note:

Url: use relative or relative location to specify the imported internal color table file. To introduce the CSS file about link. (understand how link is determined to compete with @ import)

Css @ import uses two common methods

First: the html source code (in the html file) is directly introduced into the external color table CSS file

Html file index.html code: import use instance www.CSS5.com @ import url (images/style.css); CSS5 instance test content

The style.css file code in the images folder:

@ charset "utf-8"; / * CSS5-css5.com.cn * / .wai {color:#F00}

Results:

As you can see above, using @ import in HTML code requires the use of the style tag.

Summary: to introduce an internal CSS table file directly using @ import in the HTML source code, it is necessary to put @ import into the tag to win, just as HTML needs the style tag to write CSS code directly.

The second is to introduce another CSS file using @ import in the CSS file code.

In addition to HTML source code to use the style tag to use @ import, in the CSS file code can still use @ import, this moment does not matter style tag, but directly use @ import, so you can achieve a (multiple) CSS file into the introduction of another (multiple) CSS file.

After reading this, the article "how to use @ import to introduce CSS files" has been introduced. If you want to master the knowledge points of this article, you still need to practice and use it yourself to understand it. If you want to know more about related articles, welcome to follow the industry information channel.

Tags: Files codes tags content articles source code multiple examples colors appropriateness urgency necessity methods names locations such summary commonly used ideas results Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Linux Shulou Tech Info macOS Docker Huawei