The selectors are: :root, :not, :only-child, :first-child, :last-child, :empty:target, :nth-child(n), nth-last-child( n), :nth-of-type(n), etc.
The operating environment of this tutorial: Windows 7 system, CSS3&&HTML5 version, Dell G3 computer.
:root selector: matches the document root element
:not selector: you must first set styles to the substructure elements that need to be excluded by the structural element. Effective
Example:
:only-child:
first- child, :last-child:
:nth-child(n), nth-last-child(n):
:nth-of-type(n), nth-last-of-type(n):
:nth-child(n) and :nth The difference of -of-type(n)
7. :empty: The :empty selector is used to select all elements that have no child elements or whose text content is empty.
8. :target::target selector is used to specify the style for a certain target element in the page (the id of the element is used as a hyperlink in the page). The style set by the :target selector will only take effect after the user clicks a hyperlink in the page and jumps to the target element.
Recommended learning: css video tutorial
The above is the detailed content of What are the css structured pseudo-class selectors?. For more information, please follow other related articles on the PHP Chinese website!