Skip to content
Related Articles

Related Articles

Improve Article
Save Article
Like Article

CSS | :out-of-range Selector

  • Last Updated : 07 May, 2021

The :out-of-range selector is used to select the elements that are lying outside the given range. This selector only works for input element with max and min attribute.

Example Application : Marks of a student should be from 0 to 100. If an instructor tries to enter outside range, we can highlight the value out of range.


:out-of-range {
    // CSS property



<!DOCTYPE html>
        <title>out of range selector</title>
            h1 {
            input:out-of-range {
                border: 1px solid black;
            body {
        <h2>:out-of-range Selector</h2>
        <!-- If selected number is out of given range then
        the CSS property of input elements will change. -->
        Selected Number: <input type="number" min="5" max="25">


Supported Browsers: The browser supported by :out-of-range selector are listed below: 

  • Apple Safari 10.1
  • Google Chrome 53.0
  • Firefox 50.0
  • Opera 40.0
  • Internet Explorer 13.0


My Personal Notes arrow_drop_up
Recommended Articles
Page :

Start Your Coding Journey Now!