Descendant and sibling selector selector

Universal Brother Selector

The universal sibling selector is ~: sibling selector. The position does not need to be adjacent, only the same level. After A~B selects the A element, all the B elements of the same level are at the same level .

Neighbor sibling selector

Adjacent sibling selector i.e. +when the second element immediately after the first element , and two elements belong to the same parent element of the child element, the second element will be selected .

Child selector

Child selector >: When using the> selector to separate two elements, it will only match those second elements that are direct descendants (child elements) of the first element.

Descendant selector

Matches all second elements that have the first element as the ancestor (but not necessarily the parent element), no matter how many times it "jumps" in the DOM.

Guess you like

Origin blog.csdn.net/wdhxs/article/details/111935669