:where()

Matches any element in its list of arguments, but always has zero specificity. It is ideal for setting default styles that are intended to be easily overridden.

/* Usage Example */
:where(h1, h2, h3) {
  /* Sets a default margin that can be overridden by a single class name elsewhere */
  margin-top: 2rem;
}

This comparison shows how :where() works in a real project. View snippet →

Widely available Since 2021 95% global usage

This feature is well established and works across many devices and browser versions. It has been available across browsers since 2021.

88+
78+
14+
88+
Kinsta

Your first month is free

Managed WordPress hosting for faster sites.

Learn more

New CSS drops.

Join 600+ readers who've survived clearfix hacks.

ESC