Free visual CSS tool

CSS Range Slider Styler

Style a range input's track and thumb across browsers, with a live filled-progress effect. Drag the preview, then copy the code.

45
Ready-to-use HTML + CSS + JS

A slider that actually slides

Drag the handle in the preview and watch the fill and thumb update live, exactly like the code you're about to copy.

Cross-browser thumb

Generates matching webkit and moz thumb rules so it looks right everywhere.

Live filled track

A JS input listener keeps the gradient fill in sync as you drag.

Copy clean code

Get the HTML, CSS and the small JS snippet needed to keep it working.

How to style a CSS range slider

  1. Set dimensionsAdjust the track height and thumb size until the proportions feel right.
  2. Choose colors & shapePick track, filled and thumb colors, then a circle, square or pill thumb.
  3. Drag and copyTest it by dragging the handle, then copy the HTML, CSS and JS.

About styling range inputs

The native <input type="range"> is one of the most useful and least consistently stylable HTML controls: every browser hides its actual track and thumb behind vendor-prefixed pseudo-elements instead of a shared standard, so a slider that looks polished in Chrome can look completely unstyled in Firefox unless both are targeted explicitly. The other half of the puzzle is the "filled" look popular in modern UIs, where the portion of the track behind the handle is a different color from the portion ahead of it. Browsers don't expose that boundary directly, so it's recreated with a linear-gradient background on the input itself, split at the current percentage and recalculated on every drag.

-webkit- pseudo-elements

Chrome, Edge and Safari use ::-webkit-slider-runnable-track and ::-webkit-slider-thumb, and thumbs need a manual vertical offset to center on the track.

-moz- pseudo-elements

Firefox uses ::-moz-range-track and ::-moz-range-thumb instead, and centers the thumb on the track automatically.

The gradient fill trick

Setting the track background to transparent lets a linear-gradient on the input itself show through as the "filled" portion.

Native accessibility

Because it's still a real range input, keyboard arrows, Page Up/Down and screen readers all work without extra ARIA.

CSS range slider styler FAQ

Why do I need separate CSS for Chrome and Firefox?

Range inputs are one of the few HTML controls without a shared styling API. Chrome, Edge and Safari use the -webkit-slider-runnable-track and -webkit-slider-thumb pseudo-elements, while Firefox uses -moz-range-track and -moz-range-thumb, so both rule sets are needed for consistent results.

How is the filled track effect created?

The track pseudo-elements are set to a transparent background, and a linear-gradient is applied directly to the input element itself, recalculated on every input event so the filled portion always matches the current value.

Can I change the thumb shape?

Yes. Choose a circle, square or pill-shaped thumb, and the generated webkit and moz thumb rules update to match, including a vertical centering fix for Chrome-based browsers.

Does this work with keyboard arrow keys?

Yes. Because the output is a real input[type=range] element, arrow keys, Page Up/Down, Home and End all work natively without any extra JavaScript.

Is this range slider styler free and private?

Yes. It is completely free, requires no account, and builds all HTML, CSS and JS locally in your browser.

Try other CSS UI tools

Keep building interface components with these free online tools.