HTML introduced CSS style three ways and priority:
Method
CSS style references are made in 3 different ways. inline style, inner style (inline), and external style, respectively;
Inline style: Use the object's Style property within the object's markup to define the applicable style sheet properties, defined as: <div style= "Content" ><div>;
Internal style (embedded): is the <style></style> tag pair placed in
External style: is to put the CSS file outside the Web page, through the link <link> make CSS file on this page style valid, <link type= "Text/css" rel= "stylesheet" href= "CSS File storage Address ">;
Priority: The top of the line style, the inner style (embedded) second, the external style has the lowest priority;
How CSS styles are written:
Each property has a value. Attributes and values are separated by colons; If you want to define more than one attribute, you need to separate each declaration with a semicolon;
Classification:
1. Group selector:
The grouped selectors can share the same declaration, separating the selectors that need to be grouped by commas;
H1,h2,h3,h4,h5,h6 { color: Green;}
2. Descendant selector:
The style is defined by the context of the element in its position;
Li Strong { font-style: italic; Font-weight: normal;}
3. ID selector:
The ID selector is defined as "#";
# red {color:red;} # green {color:green;}
4. Class selector :
. center {Text-align:center;}
5, Pseudo-class selector:
<a></a>
a:link {color:red;}
a:visited {color:green;}
6. Inheritance:
The child element inherits the style of the parent element, and the child elements of the child element also inherit the style, and if they do not want to be inherited, their CSS style is rewritten;
HTML introduced CSS style three methods and the style of precedence CSS