CSS: selector list (,)
Selector List
This allows you to specify multiple selectors together.
they act like “logical or”.
s1, s2, etc-
Match any selector expression s1, s2, etc.
Each expression can be compound selector or complex selector .
/* make red of all div of class x, or any span: */ div.x, span { color: red; } /* same as */ div.x { color: red; } span { color: red; }
:is(), :where() syntactic unit for Selector List
:is()
and
:where()
are like selector list, but they
represent selector list as a single
syntactic unit, so it can be used as part of other selector expression,
such as in
child selector >,
to obtain rich meaning.
CSS. Selectors
Selector types
- CSS: types of selectors
- CSS: simple selectors
- CSS: compound selectors
- CSS: complex selector (combinator)
Simple selectors
- CSS: type selector (tag name)
- CSS: universal selector (* any tag)
- CSS: class selector (.x)
- CSS: ID selector (#)
- CSS: attribute selector ([x])
Combinators
- CSS: descendant selector (space)
- CSS: child selector (>)
- CSS: adjacent sibling selector (+)
- CSS: subsequent sibling selector (~)
Selector list
Special selector
- CSS: :root selector
- CSS: no child selector
- CSS: first child, sibling rank selector
- CSS: nth-child selector
- CSS: pseudo-class selector (:)
- CSS: pseudo-element selector (::)
- CSS: negation selector (:not)
- CSS: “is any of” selector (:is, :where)
- CSS: :has descendant selector