Dev Helpers
← Back

Invalid range visual cue

Invalid range visual cue with native CSS. The preview includes a small shared demo stylesheet.

Open this example in the interactive library

Source code

<style>
  .demo:out-of-range {
    outline: 2px solid #b91c1c;
  }
</style>
<input
  class="demo"
  type="number"
  min="1"
  max="5"
  value="8"
  aria-label="Copies from one to five"
/>