Role of CSS :in-range Selector

Use the CSS :in-range selector to style <input> elements with a value within a specified range. You can try to run the following code to implement the :in-range selector −


Live Demo

<!DOCTYPE html>
         input:in-range {
            border: 3px dashed orange;
            background: yellow;
      <input type = "number" min = "5" max = "10" value = "9">
      <p>The style only works for the value entered i.e. 9</p>