Skip to main content
WizTools123
WizTools123
Free Online Tools

Tool Categories


Developer Tools New Tool

Free Online CSS Range Slider Generator for input type range

Style a real range input and drag it as you work. Track height, radius and colour, thumb size, shape, colour, border and shadow, thumb growth on hover and while dragging, a filled portion before the thumb, and a focus ring. The vendor rules are written separately, which is what makes them work.

Free Forever Nothing Uploaded Draggable preview Runs in your browser
Free Online CSS Range Slider Generator for input type range
Share this tool
Advertisement Slot (Top Banner) Google AdSense Unit • Responsive Banner
CSS Range Slider Generator Everything happens in this tab. Nothing you paste is sent anywhere.
Preview
40
78

Both sliders are real inputs. Drag them, hover the thumb, and press Tab then the arrow keys to check the focus ring.

CSS
Track px pill
Thumb px px px
Hover and drag 1.12 1.24 ms
Focus ring, always written px

The WebKit filled portion needs one line of JavaScript to keep the --pct variable in step. The output shows it.

Buy Us A Coffee

Enjoying WizTools123? Help keep our server infrastructure 100% free and open for everyone.

Buy Us A Coffee
Sponsored Content (Below Tool) Google AdSense Placement

How to Style a Range Input with CSS

A few steps, and nothing is uploaded.

1
Shape the track Set the height, the radius and the track colour. A pill radius is the usual choice for a thin track. Turn the filled portion on to colour the part of the track behind the thumb, and pick the colour it uses.
2
Shape the thumb Size, shape, colour, a border and a shadow blur. A circle with a coloured border and a white centre is the most legible combination on a dark track, and a bar thumb is useful when the value needs precision.
3
Set hover and drag The thumb can grow slightly when the pointer is over it and a little more while it is being dragged, which makes the control feel physical. Both preview sliders are real, so hover and drag them to judge the amounts.
4
Copy the whole set The output has the base rule, then the WebKit track and thumb, then the Moz track, progress and thumb, each as its own rule, plus the focus rules and the one line of JavaScript the WebKit fill needs.

What to Know About Styling Range Inputs

Including the one mistake that makes a styled range silently fail.

The track and thumb rules must be written separately for each engine, never in one selector list. WebKit and Blink expose ::-webkit-slider-runnable-track and ::-webkit-slider-thumb, Firefox exposes ::-moz-range-track and ::-moz-range-thumb, and neither engine understands the other set. CSS discards an entire rule if any selector in its list is invalid, so writing ::-webkit-slider-thumb, ::-moz-range-thumb together means Chrome throws the rule away because of the Moz selector and Firefox throws it away because of the WebKit one. The result is a slider that looks completely unstyled with no error anywhere, and this is the single most common reason a styled range silently fails. Every rule the output writes is on its own, duplicated declarations and all.
The filled portion needs a different technique in each engine. Firefox has ::-moz-range-progress, which is sized for you, so the fill is one rule with a background colour. WebKit has no equivalent at all, so the fill has to be painted on the track itself as a hard stop gradient at the current percentage, which means something has to tell CSS what that percentage is. The output uses a custom property on the element and includes the one line of JavaScript that keeps it in step on input. Without that line the WebKit fill simply stays where it started.
appearance: none is required, and the thumb needs it again. The element keeps its native rendering until appearance: none is set, and in WebKit the thumb pseudo-element needs its own -webkit-appearance: none as well, or the size and colour are ignored. The thumb also has to be centred on the track by hand in WebKit with a negative margin-top of half the difference between the thumb and the track height, because the track is a real box there while Firefox centres the thumb itself.
This page styles one horizontal slider and does not read CSS back. There is no vertical slider, no tick marks or datalist styling, no two handle range, no value bubble above the thumb and no disabled state. It cannot parse an existing stylesheet into the controls, and because the thumb is sized in pixels you should check the result on a touch screen yourself: anything under about 24 pixels is hard to grab with a thumb on glass.

Key Features & Capabilities

What this tool does, and what it deliberately does not.

Real, draggable sliders Two working range inputs with the generated CSS applied.
Correct vendor rules Each engine gets its own rule, which is the only way it works.
A filled portion Moz progress and a WebKit gradient track, both generated.
Hover and drag growth The thumb grows a little on hover and more while dragging.
A focus ring on the thumb Written every time, so the control is visible from the keyboard.
Runs in your browser Nothing is sent anywhere. The page works with the network off.

About the CSS Range Slider Generator

A range input is the hardest of the common form controls to style, because almost none of it is an ordinary box. The track and the thumb are internal parts that each engine exposes through its own pseudo-elements, with different names, different boxes and different behaviour, and there is still no standard set that works everywhere. Getting a slider to look designed means writing the same declarations two or three times over.

This page writes them for you and, more usefully, writes them apart. Grouping the WebKit and Moz selectors into one rule looks tidier and is the reason so many styled sliders quietly revert to the browser default: an unrecognised selector in a list invalidates the whole rule, so each engine discards the block because of the half belonging to the other engine. The output repeats itself on purpose.

The filled portion is the other awkward part. Firefox gives you a pseudo-element that is already the right width, while WebKit gives you nothing and has to be faked with a two stop gradient on the track, which needs the current percentage as a custom property. The tool generates both, along with the single input handler that keeps the property in step, and both preview sliders run that handler so you can see the fill move as you drag.

Frequently Asked Questions

Vendor pseudo-elements, the filled portion, focus and touch.

Almost always because the WebKit and Moz pseudo-elements were written in one selector list. CSS treats a list with an unknown selector as invalid and drops the entire rule, so each engine discards your styling because of the selector belonging to the other engine. Split them into separate rules with the same declarations in each. The other usual cause is a missing appearance: none.

In Firefox, style ::-moz-range-progress with a background colour and the browser sizes it. In WebKit there is no such pseudo-element, so put a linear-gradient on the track with two stops at the same position, both at the current percentage, and update that percentage from an input handler through a custom property. The output generates both routes and includes the handler.

Because ::-webkit-slider-runnable-track is a real box with a height, and the thumb sits on top of it rather than being centred in it. Give the thumb a negative margin-top of half the difference between the thumb size and the track height. Firefox does not need this, which is why the value is only in the WebKit rule. The tool calculates it from the sizes you set.

Yes, and you should keep something. The generated CSS puts a box-shadow ring on the thumb under :focus-visible, which reads as a focus indicator and follows the thumb as it moves. Do not simply set outline: none and stop there: a slider with no visible focus state is unusable for anyone who is tabbing through a form.

At least 24 pixels, and closer to 32 is better on a phone, because a fingertip covers a good deal more than a mouse pointer does. You can keep a small visual thumb and enlarge the hit area by giving the input more vertical padding, since the whole input responds to a drag rather than just the thumb. Test it on a real device; a desktop browser window resized narrow is not the same thing.

Other Developer Tools

Advertisement Slot (Bottom Banner) Google AdSense Unit • Responsive Banner