Web features explorer

Form validity pseudo-classes

Widely available
Tags: css Groups: CSS > Selectors

The form validity CSS pseudo-classes match <form> elements based on the constraints of a form field, such as validity (:valid, :invalid, :in-range, :out-of-range) and necessity (:optional or :required). To learn more, see :in-range, :invalid, :optional, :out-of-range, :required, :valid at MDN.

Compatibility (view on caniuse.com)