<input type="range" min="0" max="100" step="1" value="20">
<input type="range" min="0" max="100" step="1" style="--c: lightblue;--l: 6px;--g:12px;">
<input type="range" min="0" max="100" step="1" value="70" style="--c: red;--l: 4px;">
input {
--c: orange; /* active color */
--g: 8px; /* the gap */
--l: 5px; /* line thickness*/
--s: 30px; /* thumb size*/
width: 400px;
height: var(--s); /* needed for Firefox*/
-webkit-appearance :none;
-moz-appearance :none;
appearance :none;
background: none;
cursor: pointer;
outline: 2px dashed #000;
}
/* chromium */
input[type="range" i]::-webkit-slider-thumb{
height: var(--s);
aspect-ratio: 1;
border-radius: 50%;
box-shadow: 0 0 0 var(--l) inset var(--c);
border-image-source: linear-gradient(90deg,var(--c) 50%,#ababab 0);
border-image-slice: 1;
border-image-width: 0 200px;
border-image-outset: 0 calc(200px + var(--g));
-webkit-appearance: none;
appearance: none;
}
/* Firefox */
input[type="range"]::-moz-range-thumb {
height: var(--s);
width: var(--s);
background: none;
border-radius: 50%;
box-shadow: 0 0 0 var(--l) inset var(--c);
-moz-appearance: none;
appearance: none;
}
/**/
body {
margin: 0;
min-height: 100vh;
display: grid;
gap: 40px;
place-content: center;
background: repeating-linear-gradient(-45deg, #fff 0 20px, #f9f9f9 0 40px)
}
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.