Appendix C. CSS Selectors, Level 4
C
CSS Selectors, Level 4
The following table lists the selectors in the Selectors Level 4 spec (w3.org/TR/selectors-4/, November 2022).
|
Selector |
Type of selector |
Description |
|---|---|---|
|
Elemental selectors |
||
* |
Universal selector |
Matches any element. |
E
|
Type selector |
Matches the name of an element. |
E:defined |
Defined pseudo-class |
Matches an element based on whether it is defined in the host language (such as custom elements). |
|
Combinators |
||
E, F |
Compound selector |
Matches elements E and F. |
E F |
Descendant combinator |
Matches element F only if it is a descendant of element E. |
E > F |
Child combinator |
Matches any element F that is a child of element E. |
E + F |
Next-sibling combinator |
Matches any element F that immediately follows any element E, where E and F share the same parent. |
E ~ F |
Subsequent-sibling combinator |
Matches any element F that is preceded by E, where ... |
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access