Intersection selector
What is the intersection selector
Set attributes for the intersecting part of all selected labels
format
选择器1.选择器2{
属性:值;
}
important point
1. The selector can use tag name/id name/class name.
2. There is no space between the selectors.
3. The intersection selector is only for understanding, in fact, you can directly use class/id to select, which is a bit redundant.
p.para1 {
color: skyblue;
text-align: center;
}
<p>我是段落</p>
<p>我是段落</p>
<p class="para1">我是段落</p>
<p class="para2">我是段落</p>
P tag selector and class selector group and.
effect:
Union selector
What is a union selector
Set attributes for all tags selected by the selector.
format
选择器1,选择器2{
属性:值;
}
important point
1. Union selectors must be separated by commas.
2. Union selector is to write the tags/id/class with the same style together to save space.