<input type="range" value="25">
body {
height: 100vh;
margin: 0;
display: flex;
}
input[type="range"] {
margin: auto;
appearance: none;
position: relative;
overflow: hidden;
height: 40px;
width: 200px;
cursor: pointer;
border-radius: 0; /* iOS */
}
::slider-runnable-track {
background: #ddd;
}
/*
* 1. Set to 0 width and remove border for a slider without a thumb
* 2. Shadow is negative the full width of the input and has a spread
* of the width of the input.
*/
::slider-thumb {
appearance: none;
width: 20px; /* 1 */
height: 40px;
background: #fff;
box-shadow: -200px 0 0 200px dodgerblue; /* 2 */
border: 2px solid #999; /* 1 */
}
::range-track {
height: 40px;
background: #ddd;
}
::range-thumb {
background: #fff;
height: 40px;
width: 20px; /* 1 */
border: 3px solid #999; /* 1 */
border-radius: 0 !important;
box-shadow: -200px 0 0 200px dodgerblue;
box-sizing: border-box;
}
::fill-lower {
background: dodgerblue;
}
::thumb {
background: #fff;
border: 2px solid #999; /* 1 */
height: 40px;
width: 20px; /* 1 */
box-sizing: border-box;
}
::ticks-after {
display: none;
}
::ticks-before {
display: none;
}
::track {
background: #ddd;
color: transparent;
height: 40px;
border: none;
}
::tooltip {
display: none;
}
This Pen doesn't use any external CSS resources.