CSS: selector list (,)

By Xah Lee. Date: . Last updated: .

Selector List

s1, s2, etc

Match any s1, s2, etc.

s can be simple selector, 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;
}

Syntactic grouped Selector List

you can also use :is() and :where().

they are similar.

CSS. Selectors

Selector types
Simple selectors
Combinators
Selector list
Nesting syntax
Special selector
Misc