Widely availableSupported across all major browsers. Safe to use in production.

Overview

The :where() CSS functional pseudo-class takes a selector list as its argument, and matches any element that can be selected by one of the selectors in that list. It is functionally equivalent to the selectors in the list, but doesn't affect the CSS rule specificity.

Browser support

Feature Desktop Mobile
Chrome
Edge
Firefox
Safari
Chrome Android
Safari iOS
88
88
78
14
88
14
forgiving selector list

Support for forgiving selector list

88
88
82
14
88
14
1+Supported (version) Not supported Has note Sub-feature descriptions sourced from MDN Web Docs (CC BY-SA 2.5)

Syntax

CSS
/* Default style with specificity 0 */
:where(ul, ol) {
  list-style: none;
  padding: 0;
  margin: 0;
}

/* Easily overridable by the user */
.my-list {
  list-style: disc;
  padding-left: 1.5rem;
}

Live demo

detaildegree0. reset

:where() selector detaildegree0. reset demo.

PreviewFullscreen

simple to o-ba-raid

:where() selector simple to o-ba-raid demo.

PreviewFullscreen

defaultstyle

:where() selector defaultstyle demo.

PreviewFullscreen

Use cases

  • Using :where()

    The :where() CSS functional pseudo-class takes a selector list as its argument, and matches any element that can be selected by one of the selectors in that list. It is functionally equivalent to the selectors in the list, but doesn't affect the CSS rule specificity.

Cautions

  • May not be supported in older browsers.

Accessibility

  • Make sure visual changes are conveyed appropriately to assistive technology.

Powered by web-features