How to use CSS style sheets (1+XWeb certificate personal arrangement)

Introduce external formal files:
Import external style files through the "link" element. The external style files are usually files with a CSS suffix. The advantage of this method is that the style files are separated from the HTML documents. One style file can be reused with multiple HTML documents. Good sex

Import external style files:
use @import to import through the "style" element, the effect is the same as that of imported external style files

Use internal style definition:
directly write the CSS style sheet as the "style" element as the content of the element. This writing method has poor versatility and sometimes causes the HTML document to be too large. When the repeated CSS code exists in different HTML documents, it will inevitably lead to A large number of repeated downloads, and hope that some CSS is only valid for a certain page, usually take this form

Use inline style definition:
write the CSS style sheet into the element's general attribute "style". This method is only effective for a single element and will not affect the entire file. It can accurately control the display effect of the HTML document

Guess you like

Origin blog.csdn.net/qq_44948696/article/details/109773414