What is the CSS Range Slider Generator?
Style custom range input sliders with CSS. Configure thumb size, track height, fill colour, and hover states.
Everything runs locally in your browser. Adjust the controls above, preview instantly, and copy clean, production-ready CSS — no account, no upload.
Using the CSS Range Slider Generator
Everything lives in the panel at the top of this page. There is nothing to install — it all runs right here in your browser.
Set track height and colour
The track is the horizontal bar. Set its height (2px-8px) and background colour for the unfilled portion.
Configure the thumb
Set thumb diameter (12px-24px) and colour. The thumb is the draggable handle.
Copy the CSS
Both -webkit and -moz syntaxes are included. Apply the class to your range input element.
What the generated code looks like
Clean, production-ready CSS — no vendor bloat, no unnecessary declarations.
input[type="range"].custom-range {
-webkit-appearance: none;
appearance: none;
width: 100%;
height: 4px;
border-radius: 2px;
background: #e5e7eb;
outline: none;
cursor: pointer;
}
input[type="range"].custom-range::-webkit-slider-thumb {
-webkit-appearance: none;
appearance: none;
width: 18px;
height: 18px;
border-radius: 50%;
background: #0071e3;
cursor: pointer;
transition: transform 0.1s;
}
input[type="range"].custom-range::-webkit-slider-thumb:hover {
transform: scale(1.2);
}
input[type="range"].custom-range::-moz-range-thumb {
width: 18px;
height: 18px;
border: none;
border-radius: 50%;
background: #0071e3;
cursor: pointer;
}Range inputs require separate -webkit-slider-thumb and -moz-range-thumb rules. Chromium-based browsers (Chrome, Edge, Opera, Safari) use the -webkit prefix. Firefox uses -moz.
Common mistakes & how to fix them
A few habits trip people up. Here is what to watch for — and the exact fix.
Missing appearance: none on the input
Without appearance: none, the browser default range track renders over the custom track.
Fix: Add both -webkit-appearance: none and appearance: none to the input[type="range"] rule.
Pro tips for better results
Show fill progress with a linear-gradient background
CSS cannot natively fill the track up to the thumb position. Use a JavaScript input event listener to update a CSS custom property and apply it as a linear-gradient background on the track.
Frequently asked questions
From the blog
Read more →Modern CSS techniques every developer should know
A practical tour of the CSS features that replaced yesterday’s hacks.
From design to code without the friction
How visual generators speed up the build without sacrificing clean output.
Writing CSS that scales with your project
Tokens, naming, and structure that keep large stylesheets maintainable.