CSS :out-of-range Selector

❮ Previous Selectors Next ❯

Example

input:in-range {
  border: 4px solid green;
}

input:out-of-range {
  border: 2px solid red;
}

Meaning

The :out-of-range selector represents an <input> element whose current value is out of the range limits specified by the min and max attributes.

This pseudo-class is useful for giving the user a visual indication that a field's current value is outside the permitted limits.

Note: This pseudo-class only applies to elements that have (and can take) a range limitation. In the absence of such a limitation, the element can neither be in-range nor out-of-range.

Version: CSS3




Standard Syntax

:out-of-range {
  css declarations;
}



Browser Support

The numbers in the table specify the first browser version that fully supports the property.




Status







❮ Previous Selectors Next ❯