CSS: selector list (,)

By Xah Lee. Date: . Last updated: .

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
Simple selectors
Combinators
Selector list
Special selector
Misc