:in-range

Targets form inputs (like type='number') whose current value is between the minimum and maximum limits set by 'min' and 'max' attributes.

Quick example

input:in-range {
  /* Highlights the input when the number is valid */
  border: 2px solid green;
  background-color: #f0fff0;
}

:in-range Browser Support

Widely available Since 2015 96% global usage

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

Safe to use without fallbacks.

10+
29+
5.1+
13+
ESC