Refer to this blog post
1. Inline style sheet
Refers to the CSS style encoding written in the HTML tag, the style written within the label can affect the smallest range, only change the text style of the label, the same label will not be affected, also known as the row style table.
The format is as follows
The inline style sheet is supported by the style of the HTML element of the HTML element, just separating the CSS code with a semicolon in style= "". This is the most basic form, but it does not implement the performance and content separation and cannot control multiple pages flexibly, so we just use when debugging CSS code.
2. Internal style sheet
In HTML, you can set styles that affect the entire document through the Apply <style> tag, and the inner style sheet can put the style in a fixed position when compared to the rows.
The format is as follows
The internal style sheet encoding is the primary application form and cannot be used for cross-page use.
3. External style sheet
3.1 We used the <link> tag in
The code for the external style.css is:
H1{font-size:12px;color: #000FFF}
3.2 Referencing an external style sheet using @import
@import used within the <style> tag and must precede other CSS styles, the syntax code is as follows:
@import URL (external style address)
URL is a keyword, can not be arbitrarily changed, external style address refers to the external style of the URL, can be absolute, can also be relative, in addition to the syntax and location and <link> tag, the other uses and effects are the same.
<style type= "text/css" > @import url (8.4.1.css); h1{color:red}</style>
Notice that there is a semicolon behind it.
CSS style sheet settings