Home>Article>Web Front-end> What are the css descendant selectors?
css descendant selectors include: 1. "Parent element * {}", find all descendant elements from the parent element. 2. "Parent Children {}" is to find the specified child element from the parent element; 3. "Parent Child 1 Child 2 {}" is to find the child 1 from the parent, and then from the child Generation 1 finds descendant 2.
The operating environment of this tutorial: Windows 7 system, CSS3&&HTML5 version, Dell G3 computer.
The descendant selector is also called the containing selector.
The descendant selector can select elements that are descendants of an element.
Descendant selector concentrated form:
1,Parent * {}
Find all descendants from Parent.
2,parent generation child1{}
is to find child1 from the parent generation orparent generation child2{}
is to be found from the parent generation Offspring 2.
3,Parent Generation Child 1 Child 2{}
This is to find Child 1 from Parent Generation, and then find Child 2 from Child 1.
The first form: Although all are selected, * has a lower priority.
abc
Second form:
abc
The third form: it cannot select .b and .c at the same time, only .c.
abc
Another thing to note is the following code: a p is nested in a p with a class name of c, and a p with a class name of c is nested in it. At this time, it will also be selected
abcspan
(Learning video sharing:css video tutorial)
The above is the detailed content of What are the css descendant selectors?. For more information, please follow other related articles on the PHP Chinese website!