Role of CSS: out-of-range Selector

CSSWeb DevelopmentFront End Technology

Use the CSS :out-of-range selector to style <input> elements with a value outside a specified range.


You can try to run the following code to implement the :out-of-range selector

Live Demo

<!DOCTYPE html>
         input:out-of-range {
            border: 3px dashed orange;
            background: yellow;
      <input type = "number" min = "5" max = "10" value = "15">
      <p>The style only works for the value entered out of range</p>
Published on 09-May-2018 07:48:23