Three CSS styles and three CSS styles
From the perspective of CSS style code insertion, there are three types: inline, embedded, and external.
1: inlineThe css style sheet directly writes the css code in the existing HTML Tag, as shown in the following code:
<p>
3: the external css style is written in a separate file.
The external css style (also known as the external style) is to write the css code into a separate external file. This css style File.css"Is the extension. in
<link href="base.css" rel="stylesheet" type="text/css" />
Note:
1. the css style file name should be named with meaningful English letters, such as main.css.
2. rel = "stylesheet" type = "text/css" is a fixed writing method that cannot be modified.
3. The <link> tag location is generally written in the
These three styles have priorities. remember their priorities:Inline> embedded> externalBut embedded> external style has a premise: the position of the embedded css style must be behind the external style.
In summary-- Proximity principle (the closer the element to be set, the higher the priority level).
However, note that the priorities summarized above have one premise: the css styles in inline, embedded, and external style tables share the same weights.