Get the App
SLTechnology News&Howtos  ›  Development  › 

What are the common ways to use @ import in css

Shulou Source: shulou.com Published: 2022-06-01 07:06:45 11月13日 Update

This article mainly introduces what methods are commonly used in @import in css, which has certain reference value. Interested friends can refer to it. I hope you will gain a lot after reading this article. Let Xiaobian take you to understand it together.

The first type: html source code (html file) directly into the internal format table CSS file

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

style.css file code in images folder:

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

Attainments:

Use @import to win and import internal CSS files

The above generalizations show that using @import in HTML code requires the use of style tags.

Summary: To directly apply @import to HTML source code to introduce external CSS pattern files, you need to put @import into the tag power victory, just like HTML directly writing CSS code also needs style tags.

The second type: CSS file code using @import to introduce another CSS file

In addition to using the style tag to use @import in HTML source code, you can still use @import in CSS file code. In this case, you don't need the style tag, but you can directly apply @import, so that you can introduce one CSS file (s) into another CSS file (s).

Thank you for reading this article carefully. I hope that Xiaobian will share "what are the commonly used methods in css @import". This article is helpful to everyone. At the same time, I hope that everyone will support you a lot. Pay attention to the industry information channel. More relevant knowledge is waiting for you to learn!

Tags: Files code tags articles source code commonly used methods multiple examples applications general value interest content at the same time power summary folders time more Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Microsoft OPPO Reno MySQL Shulou Tech Info Huawei