CSS :where() Pseudo-class

Definition and Usage

CSS :where() pseudo-classes are used to apply the same style to all elements within the parentheses.

:where() pseudo-classes require a comma-separated list of selectors as their parameters.

:where() Pseudo-classes with :is() pseudo-classes are similar but differ in specificity::where() has a specificity of 0, while :is() The specificity depends on the most specific selector in its parameters.

Example

Apply red text color to p.intro, <ul>, and <ol> elements:

:where(p.intro, ul, ol) {
  color: red;
}

Try It Yourself

CSS Syntax

:where(selector-list) {
  css declarations;
}

Technical Details

Version: CSS4

Browser Support

The numbers in the table specify the first browser version that fully supports this pseudo-class.

Chrome Edge Firefox Safari Opera
88 88 78 14 74