coderef

:not()Baseline · Widely available

The :not() functional pseudo-class matches elements that do not match the selectors in its argument.

Supported in all major browsers for at least 30 months — safe to use without fallbacks. Baseline since Jan 21, 2021. Widely available since Jul 21, 2023.

Browser support

DesktopChrome
1–87Not supported
88+Supportedsince Jan 19, 2021
Current: 155
Edge
12–87Not supported
88+Supportedsince Jan 21, 2021
Current: 154
Firefox
1–83Not supported
84+Supportedsince Dec 15, 2020
Current: 157
Safari
1–8Not supported
9+Supportedsince Sep 30, 2015
Current: 27
MobileChrome Android
18–87Not supported
88+Supportedsince Jan 19, 2021
Current: 155
Firefox Android
4–83Not supported
84+Supportedsince Dec 15, 2020
Current: 157
Safari iOS
1–8Not supported
9+Supportedsince Sep 16, 2015
Current: 27

How to use

This feature is Baseline widely available — use it freely, no fallback needed.

Example

Full syntax and examples are on MDN: :not.

Feature detection

CSS · check before using
@supports selector(:not(*)) {
  /* styles that use :not(*) */
}

/* or in JavaScript */
if (CSS.supports("selector(:not(*))")) {
  // use it
}

Sub-features

Support for each part of the feature (2). The overall table above shows when the whole feature works.

Sub-featureChromeEdgeFirefoxSafariChrome AndroidFirefox AndroidSafari iOS
not11213.11842
not.selector_list888884988849