1 Tag Selector
is to use the tag name as the selector.
1 All tags can be used as a selector, such as body, H1, DL, UL, span, etc.
2 No matter how deep the label is, it can be chosen.
3 The choice is all, not one. So it's a commonality, not a feature.
a{
Text-decoration:none; }
2 ID Selector (strict case difference)
1 #lj1 {
2 font-size:60px;
3 font-weight:bold;
4 Color:black; } 3 class selector
class attribute can be repeated
1
2
class= "Teshu"> I'm a h3.
3
4 <p> I am a paragraph ah </p>
5 <p class= "Teshu"> I'm a paragraph </p> <p class= "Teshu"> I'm a paragraph </P&G T
1 . teshu{
2 color:red; } 4 descendant selector
A space is a descendant,. Div1 P is the offspring of Div1. All P
1 <styletype= "Text/css" >
2 . Div1 P{
3 color:red;
4} </style>
1 <divclass= "Div1" >
2 <ul>
3 <li>
4 <p> Paragraph </p>
5 <p> Paragraph </p>
6 <p> paragraph </p>
7 </li>
8 </ul> </div> 5 intersection selector
The selected element is satisfied with two criteria: must be a H3 label and then must be a special label.
The intersection selector has no spaces.
<style type= "Text/css" >
h3.special{
color:red;
</style>
6-Set selector (group selector)
To represent and set with commas
h3,li{
color:red;
}
<ul>
<li> I am a list </li>
</ul>