coderef

:user-valid and :user-invalidBaseline · Widely available

The :user-valid and :user-invalid pseudo-classes match form controls that have been marked as valid or invalid based on their validation constraints.

Supported in all major browsers for at least 30 months — safe to use without fallbacks. Baseline since Nov 2, 2023. Widely available since May 2, 2026.

Browser support

DesktopChrome
1–118Not supported
119+Supportedsince Oct 31, 2023
Current: 155
Edge
12–118Not supported
119+Supportedsince Nov 2, 2023
Current: 154
Firefox
1–87Not supported
88+Supportedsince Apr 19, 2021
Current: 157
Safari
1–16.4Not supported
16.5+Supportedsince May 18, 2023
Current: 27
MobileChrome Android
18–118Not supported
119+Supportedsince Oct 31, 2023
Current: 155
Firefox Android
4–87Not supported
88+Supportedsince Apr 19, 2021
Current: 157
Safari iOS
1–16.4Not supported
16.5+Supportedsince May 18, 2023
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: :user-invalid.

Feature detection

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

/* or in JavaScript */
if (CSS.supports("selector(:user-invalid)")) {
  // 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
user-invalid1191198816.51198816.5
user-valid1191198816.51198816.5