Get the App
SLTechnology News&Howtos  ›  Development  › 

How to import HTML external style sheets

Shulou Source: shulou.com Published: 2022-06-01 04:34:13 10月03日 Update

This article introduces the relevant knowledge of "how to import HTML external stylesheets". In the operation of actual cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!

The @ import rule is another way to load external stylesheets. The @ import statement instructs the browser to load an external stylesheet and use its style.

You can use it in two ways. The easiest way is to use it in your partial elements. Note that other CSS rules may still be contained in the element.

Try this code for example »

@ import url ("css/style.css")

P {

Color: blue

Font-size: 16px

}

Similarly, you can import a stylesheet in another style sheet using the @ import rule.

Try this code for example »

@ import url ("css/layout.css")

@ import url ("css/color.css")

Body {

Color: blue

Font-size: 14px

}

This is the end of how to import HTML external stylesheets. Thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!

Tags: Styles rules code elements content methods more knowledge practicality learning and then through dilemmas facts situations instructions articles ways is in the case. Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno MariaDB NVidia Shulou Information Apple Shulou Tech Info