Styling a Range Input

suggest change

Start with the native control and use accent-color for a portable theme:

<label>
  Volume
  <input type="range" min="0" max="100" value="50">
</label>
input[type="range"] {
  inline-size: min(100%, 24rem);
  accent-color: rebeccapurple;
}

Fully replacing the track and thumb still requires engine-specific pseudo-elements such as ::-webkit-slider-thumb and ::-moz-range-thumb; there is not yet one interoperable standard pseudo-element for every range part. Prefer the native control unless the design genuinely requires a custom appearance.

When customizing it:

Avoid the obsolete ::-ms-* selectors, which targeted legacy Internet Explorer.

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents