Get the App
SLTechnology News&Howtos  ›  Development  › 

Sharing of four priority Writing methods of css

Shulou Source: shulou.com Published: 2022-06-03 16:13:27 10月03日 Update

This article mainly explains "the four priority writing ways of css". The content of the article is simple and clear, and it is easy to learn and understand. Please follow the editor's train of thought to study and learn "the four priority writing ways of css".

Priority: external style < internal style sheet < inline style sheet

Priority, that is, the selector with the same name on the right will override the left

1. Internal style sheet

CSS Code copies content to the clipboard

/ * Internal style sheets, which are generally used to override common styles * /

# headTip {

Color: 0xff5

}

two。 Using the link tag to declare the use of external resources in the document is one of the most common ways.

The css external stylesheet specifies the encoded @ CHARSET= "utf-8"; needs to be placed on the first line.

XML/HTML Code copies content to the clipboard

3. @ mode, introduce css, note that this is loaded asynchronously and only after the entire html is loaded, which will cause the page to flicker. It is not recommended.

CSS Code copies content to the clipboard

@ import 'my-common.css'

4. Inline stylesheets, the highest priority and the most straightforward, but not reusable and not easy to maintain.

XML/HTML Code copies content to the clipboard

Thank you for your reading. the above is the content of "sharing the four priority Writing methods of css". After studying this article, I believe you have a deeper understanding of the sharing of the four priority writing methods of css, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!

Tags: Style priority mode content clipboard clip learning highest straightforward one line right that is commonly used ideas situations documents articles more tags knowledge Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno NVidia Xiaomi Docker macOS vpn