Tag Selector
The name of the style is the same as the name of the label, such as the P tag in the example, the style with the name P, and if there is more than one P tag in the page, these P tags share the style
p{Color:blue;} <p> Tag Selector </p>
Class Selector
1. A C1 style can be used multiple times, as shown below
. c1{ color:red;}
<p class= "C1" >class selector </p>
2. There can be more than one style in a class
. c1{ color:red;}. c2{ font-size:20px;}
<p class= "C1 C2" >class selector </p>
ID Selector
A page cannot have a sample ID name in multiple tags, that is, the ID selector is not used as many times as the class selector, it can only be used once in the same page
Priority level
ID selector >class Selector > tag Selector
Meaning of supplemental spaces
White space means: what's underneath what's what, as shown below
Div. c1{//separated by a space color:green;}<Div> <Pclass= "C1">Selector Selector</P></Div><Pclass= "C1">Selector Selector</P>
Meaning of the comma
Comma means: what and what
. c1,.c2{ --separated by commas color:green;}
<p class= "C1" > Selector </p>
<p class= "C2" > Selector </p>
CSS most commonly used three kinds of selector