Skip to content

CSS Selectors

Selector List


The selector list , is a list of CSS selectors separated by commas. It selects all the elements that match any of the selectors in the list.

Selector List

The selector matches all div elements, all elements with the class .two, and all elements with the id #three.

Unsupported selector

If the selector list contains an invalid selector, like p:this-is-invalid (there is no such pseudo-class), the entire selector list is invalid even if the other selectors in the list are valid. This matters if you use a selector that is not supported by all browsers.