Please take a look at the following CodePen. There you can see my custom range input. I want the tick positions of the slider to be shown and for that I added the datalist:
fieldset {
border: 2px solid #48530D;
padding-top: 27px;
padding-right: 20px;
padding-bottom: 0px;
padding-left: 20px;
}
input[type=range] {
-webkit-appearance: none;
width: 100%;
margin: 4px 0;
}
input[type=range]:focus {
outline: none;
}
input[type=range]::-webkit-slider-runnable-track {
width: 100%;
height: 8px;
cursor: pointer;
box-shadow: 0px 0px 0px rgba(0, 0, 0, 0), 0px 0px 0px rgba(13, 13, 13, 0);
background: #a4b162;
border-radius: 0px;
border: 1px solid rgba(0, 0, 0, 0);
}
input[type=range]::-webkit-slider-thumb {
box-shadow: 0px 0px 0px #000000, 0px 0px 0px #0d0d0d;
border: 1px solid #000000;
height: 16px;
width: 16px;
border-radius: 0px;
background: #48530d;
cursor: pointer;
-webkit-appearance: none;
margin-top: -5px;
}
input[type=range]:focus::-webkit-slider-runnable-track {
background: #a6b365;
}
input[type=range]::-moz-range-track {
width: 100%;
height: 8px;
cursor: pointer;
box-shadow: 0px 0px 0px rgba(0, 0, 0, 0), 0px 0px 0px rgba(13, 13, 13, 0);
background: #a4b162;
border-radius: 0px;
border: 1px solid rgba(0, 0, 0, 0);
}
input[type=range]::-moz-range-thumb {
box-shadow: 0px 0px 0px #000000, 0px 0px 0px #0d0d0d;
border: 1px solid #000000;
height: 16px;
width: 16px;
border-radius: 0px;
background: #48530d;
cursor: pointer;
}
input[type=range]::-ms-track {
width: 100%;
height: 8px;
cursor: pointer;
background: transparent;
border-color: transparent;
color: transparent;
}
input[type=range]::-ms-fill-lower {
background: #a2af5f;
border: 1px solid rgba(0, 0, 0, 0);
border-radius: 0px;
box-shadow: 0px 0px 0px rgba(0, 0, 0, 0), 0px 0px 0px rgba(13, 13, 13, 0);
}
input[type=range]::-ms-fill-upper {
background: #a4b162;
border: 1px solid rgba(0, 0, 0, 0);
border-radius: 0px;
box-shadow: 0px 0px 0px rgba(0, 0, 0, 0), 0px 0px 0px rgba(13, 13, 13, 0);
}
input[type=range]::-ms-thumb {
box-shadow: 0px 0px 0px #000000, 0px 0px 0px #0d0d0d;
border: 1px solid #000000;
height: 16px;
width: 16px;
border-radius: 0px;
background: #48530d;
cursor: pointer;
height: 8px;
}
input[type=range]:focus::-ms-fill-lower {
background: #a4b162;
}
input[type=range]:focus::-ms-fill-upper {
background: #a6b365;
}
<fieldset>
<form>
<input max="6" min="1" step="1" name="question_three" type="range" list="question_three_list" />
<datalist id="question_three_list">
<option>1</option>
<option>2</option>
<option>3</option>
<option>4</option>
<option>5</option>
<option>6</option>
</datalist>
</form>
</fieldset>
But unfortunately nothing is showing up. What I wanted to achieve is the
following (ugly example created in MS Paint, but I guess you will get what I mean):
So how can I achieve that?
I know my answer is way way late, but I keep coming back here when I try to find doing the same thing. I did manage to display tickmarks using the following settings.
The code results in the following:
* {
box-sizing: border-box;
}
.slider {
-webkit-appearance: none;
appearance: none;
width: 100%;
height: 25px;
background: #D3D3D3;
outline: none;
opacity: 0.7;
-webkit-transition: .2s;
transition: opacity .2s;
}
.slider:hover {
opacity: 1;
}
.slider::-webkit-slider-thumb {
-webkit-appearance: none;
appearance: none;
width: 25px;
height: 25px;
background: #FF0000;
cursor: pointer;
}
.slider::-moz-range-thumb {
width: 25px;
height: 25px;
background: #FF0000;
cursor: pointer;
}
.sliderticks {
display: flex;
justify-content: space-between;
padding: 0 10px;
}
.sliderticks p {
position: relative;
display: flex;
justify-content: center;
text-align: center;
width: 1px;
background: #D3D3D3;
height: 10px;
line-height: 40px;
margin: 0 0 20px 0;
}
<div class="range">
<input type="range" min="0" max="5" value="2" class="slider">
<div class="sliderticks">
<p>0</p>
<p>1</p>
<p>2</p>
<p>3</p>
<p>4</p>
<p>5</p>
</div>
</div>
-webkit-appearance: none;
The above removes platform-native styling (Chrome / Safari), which removes the ticks.
You can get more information here, but unfortunately, styling support for input ranges (particularly ticks) is still pretty terrible.
document.querySelectorAll(".__range-step").forEach(function(ctrl) {
var el = ctrl.querySelector('input');
var output = ctrl.querySelector('output');
var newPoint, newPlace, offset;
el.oninput =function(){
// colorize step options
ctrl.querySelectorAll("option").forEach(function(opt) {
if(opt.value<=el.valueAsNumber)
opt.style.backgroundColor = '#48530d';
else
opt.style.backgroundColor = '#a4b162';
});
};
el.oninput();
});
.__range input
{
outline: none;
-webkit-appearance: none;
background-color: #aaa;
height: 3px;
width: 100%;
margin: 10px auto;
}
input[type=range]::-webkit-slider-runnable-track {
width: 100%;
height: 8px;
cursor: pointer;
box-shadow: 0px 0px 0px rgba(0, 0, 0, 0), 0px 0px 0px rgba(13, 13, 13, 0);
background: #a4b162;
border-radius: 0px;
border: 1px solid rgba(0, 0, 0, 0);
}
input[type=range]::-webkit-slider-thumb {
box-shadow: 0px 0px 0px #000000, 0px 0px 0px #0d0d0d;
border: 1px solid #000000;
height: 16px;
width: 16px;
border-radius: 0px;
background: #48530d;
cursor: pointer;
-webkit-appearance: none;
margin-top: -5px;
}
.__range-step{
position: relative;
}
.__range-max{
float: right;
}
.__range-step datalist {
position:relative;
display: flex;
justify-content: space-between;
height: auto;
bottom: 16px;
/* disable text selection */
-webkit-user-select: none; /* Safari */
-moz-user-select: none; /* Firefox */
-ms-user-select: none; /* IE10+/Edge */
user-select: none; /* Standard */
/* disable click events */
pointer-events:none;
}
.__range-step datalist option {
width: 10px;
height: 10px;
min-height: 10px;
padding:0;
line-height: 40px;
}
.__range{
margin:10px 40px;
}
<div class="__range">
<input value="4" type="range" max="6" min="1" step="1" list="ticks1">
</div>
<div class="__range __range-step">
<input value="4" type="range" max="6" min="1" step="1" list="ticks1">
<datalist id="ticks1">
<option>1</option>
<option>2</option>
<option>3</option>
<option>4</option>
<option>5</option>
<option>6</option>
</datalist>
</div>
Related
I'm trying to create an application that uses spotify's apis, But I'm trying to set an input range thumb track to not 'expand' on click, although this error in the video occurs for some unknown reason.
I tried setting the range pointer-even attributes to things like, "auto" or "none" (with !important as well) but either or don't work. Any help?
Range's CSS:
.container {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}
.box-minmax {
margin-top: 30px;
width: 608px;
display: flex;
justify-content: space-between;
font-size: 20px;
color: #fff;
}
.box-minmax span:first-child {
margin-left: 10px;
}
.range-slider {
margin-top: -2vh;
}
.rs-range {
margin-top: 29px;
margin: 0 auto !important;
width: 300px;
-webkit-appearance: none;
}
.rs-range:focus {
outline: none;
}
.rs-range::-webkit-slider-runnable-track {
width: 50%;
height: 2px;
cursor: pointer;
box-shadow: none;
background: rgb(78, 78, 78);
border-radius: 0px;
border: 0px solid #010101;
pointer-events: auto;
overflow: visible;
}
.rs-range::-moz-range-track {
width: 50%;
height: 2px;
cursor: pointer;
box-shadow: none;
background: rgb(78, 78, 78);
border-radius: 0px;
border: 0px solid #010101;
pointer-events: none;
overflow: visible;
}
.rs-range::-webkit-slider-thumb {
box-shadow: none;
border: 0px solid #fff;
box-shadow: 0px 10px 10px rgba(0, 0, 0, 0.25);
height: 16px;
width: 16px;
border-radius: 22px;
background: rgb(78, 78, 78);
cursor: pointer;
-webkit-appearance: none;
margin-top: -8px;
}
.rs-range::-moz-range-thumb {
box-shadow: none;
border: 0px solid #fff;
box-shadow: 0px 10px 10px rgba(0, 0, 0, 0.25);
height: 16px;
width: 16px;
border-radius: 22px;
background: rgba(255, 255, 255, 1);
cursor: pointer;
-webkit-appearance: none;
margin-top: -8px;
}
.rs-range::-moz-focus-outer {
border: 0;
}
.rs-label {
position: relative;
display: block;
background: transparent;
line-height: 30px;
text-align: center;
margin-left: -255px;
margin-top: 7px;
left: attr(value);
font-size: 15px;
color: rgb(99, 99, 99);
}
HTML:
<form class="range-field w-64">
<div class="range-slider">
<input id="rs-range-line" class="rs-range" type="range" value="0" min="0">
<span id="rs-bullet" class="rs-label">0</span>
</div>
</form>
Video: https://imgur.com/a/IuLaUbb
I have a input type range inside a div and I'm using the pseudo element 'before' as a circle. My intention is for it to be like the thumb at the starting position: I have the following html:
<div class="range">
<input type="range" name="" class="progress" value="0" max="100" min="0"/>
</div>
with the following css:
.range::before{
content: '';
display: inline-block;
width: 15px;
height: 15px;
-moz-border-radius: 15px;
-webkit-border-radius: 15px;
border-radius: 15px;
background-color: #69b6d5;
}
Here is a functioning fiddle
My intention is to make the before element at the same position as the beginning of the range.
Added inline-block to .range::before and input and aligned them vetically using vertical-align: middle.
Set width of input to width: calc(100% - 15px). This 15px is the width of the .range::before element.
Bring the .range::before over the yellow dot using transform: translate(100%, 0)
See demo below:
/* RANGE */
input[type=range] {
-webkit-appearance: none;
margin: 10px 0;
width: calc(100% - 15px);
display: inline-block;
vertical-align: middle;
padding: 0;
border: none;
}
input[type=range]:focus {
outline: none;
}
input[type=range]::-webkit-slider-runnable-track {
width: 100%;
height: 3px;
cursor: pointer;
animate: 0.2s;
box-shadow: 0px 0px 0px #000000;
background: #FFE000;
border-radius: 7px;
border: 0px solid #FFE000;
}
input[type=range]::-webkit-slider-thumb {
box-shadow: 0px 0px 0px #FFE000;
border: 2px solid #FFE000;
height: 15px;
width: 15px;
border-radius: 15px;
background: #FFE000;
cursor: pointer;
-webkit-appearance: none;
margin-top: -7px;
}
input[type=range]:focus::-webkit-slider-runnable-track {
background: #FFE000;
}
input[type=range]::-moz-range-track {
width: 100%;
height: 3px;
cursor: pointer;
animate: 0.2s;
box-shadow: 0px 0px 0px #000000;
background: #FFE000;
border-radius: 7px;
border: 0px solid #FFE000;
}
input[type=range]::-moz-range-thumb {
box-shadow: 0px 0px 0px #FFE000;
border: 2px solid #FFE000;
height: 15px;
width: 15px;
border-radius: 15px;
background: #FFE000;
cursor: pointer;
}
input[type=range]::-ms-track {
width: 100%;
height: 3px;
cursor: pointer;
animate: 0.2s;
background: transparent;
border-color: transparent;
color: transparent;
}
input[type=range]::-ms-fill-lower {
background: #FFE000;
border: 0px solid #FFE000;
border-radius: 14px;
box-shadow: 0px 0px 0px #000000;
}
input[type=range]::-ms-fill-upper {
background: #FFE000;
border: 0px solid #FFE000;
border-radius: 14px;
box-shadow: 0px 0px 0px #000000;
}
input[type=range]::-ms-thumb {
box-shadow: 0px 0px 0px #FFE000;
border: 2px solid #FFE000;
height: 15px;
width: 15px;
border-radius: 15px;
background: #FFE000;
cursor: pointer;
}
input[type=range]:focus::-ms-fill-lower {
background: #FFE000;
}
input[type=range]:focus::-ms-fill-upper {
background: #FFE000;
}
.range {
position: relative;
display: table;
margin: 0 auto;
width: 50vw;
}
.range::before {
content: '';
display: inline-block;
vertical-align: middle;
transform: translate(100%, 0);
width: 15px;
height: 15px;
-moz-border-radius: 15px;
-webkit-border-radius: 15px;
border-radius: 15px;
background-color: #69b6d5;
}
<div class="range">
<input type="range" name="" class="progress" value="0" max="100" min="0" />
</div>
Let me know your feedback on this. Thanks!
It's a bit hacky, but how about adding this to .range::before:
.range::before {
/* ... other css */
position: absolute;
margin-top: 11px;
}
JSFiddle
I have a question about html and css. I am trying to make an div with text---slider--text. Here is the photo of how it supposed to look.
This is my current situation.
I hope someone can help me with getting this elements on 1 line.
.information_seperator {
height: 4vh;
background-color: #ffffff;
}
.divider {
width: 50vw;
background-color: #ffc539;
margin-top: 0px;
margin-bottom: 0px;
}
.divider:after {
content: " ";
width: 5px;
height: 5px;
position: relative;
top: 0;
right: 10px;
background-color: #ffc539;
}
<div class="information_seperator">
<!--<div class="row">-->
<span class="text_info">AMS</span>
<hr class="divider">
<!--<input data-provide="slider" id="ex1" data-slider-id='ex1Slider' type="text" data-slider-min="0" data-slider-max="20" data-slider-step="1" data-slider-value="20"/>-->
<!--<span style="color: #ffc539">●</span>-->
<span>JFC</span>
<!--</div>-->
</div>
You can do this with Flexbox and JQuery UI
$('.circle').draggable({
axis: "x",
containment: ".line"
});
.slider {
display: flex;
align-items: center;
}
.line {
flex: 1;
height: 4px;
background: #FBC538;
position: relative;
margin: 0 10px;
}
.circle {
width: 20px;
height: 20px;
border-radius: 50%;
background: #FBC538;
position: absolute;
left: 0;
top: -8px;
}
span:not(.circle) {
font-size: 30px;
font-weight: bold;
font-family: Sans-serif;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.4/jquery-ui.min.js"></script>
<div class="slider">
<span>AMS</span>
<div class="line"><span class="circle"></span></div>
<span>JFC</span>
</div>
I think you need to read up on
display: inline-block
To align elements next to one another use : display:inline;
Example :
span,
div {
display: inline;
}
//Slider
input[type=range] {
-webkit-appearance: none;
margin: 18px 0;
width: 100%;
}
input[type=range]:focus {
outline: none;
}
input[type=range]::-webkit-slider-runnable-track {
width: 100%;
height: 8.4px;
cursor: pointer;
animate: 0.2s;
box-shadow: 1px 1px 1px #000000, 0px 0px 1px #0d0d0d;
background: #3071a9;
border-radius: 1.3px;
border: 0.2px solid #010101;
}
input[type=range]::-webkit-slider-thumb {
box-shadow: 1px 1px 1px #000000, 0px 0px 1px #0d0d0d;
border: 1px solid #000000;
height: 36px;
width: 16px;
border-radius: 3px;
background: #ffffff;
cursor: pointer;
-webkit-appearance: none;
margin-top: -14px;
}
input[type=range]:focus::-webkit-slider-runnable-track {
background: #367ebd;
}
input[type=range]::-moz-range-track {
width: 100%;
height: 8.4px;
cursor: pointer;
animate: 0.2s;
box-shadow: 1px 1px 1px #000000, 0px 0px 1px #0d0d0d;
background: #3071a9;
border-radius: 1.3px;
border: 0.2px solid #010101;
}
input[type=range]::-moz-range-thumb {
box-shadow: 1px 1px 1px #000000, 0px 0px 1px #0d0d0d;
border: 1px solid #000000;
height: 36px;
width: 16px;
border-radius: 3px;
background: #ffffff;
cursor: pointer;
}
input[type=range]::-ms-track {
width: 100%;
height: 8.4px;
cursor: pointer;
animate: 0.2s;
background: transparent;
border-color: transparent;
border-width: 16px 0;
color: transparent;
}
input[type=range]::-ms-fill-lower {
background: #2a6495;
border: 0.2px solid #010101;
border-radius: 2.6px;
box-shadow: 1px 1px 1px #000000, 0px 0px 1px #0d0d0d;
}
input[type=range]::-ms-fill-upper {
background: #3071a9;
border: 0.2px solid #010101;
border-radius: 2.6px;
box-shadow: 1px 1px 1px #000000, 0px 0px 1px #0d0d0d;
}
input[type=range]::-ms-thumb {
box-shadow: 1px 1px 1px #000000, 0px 0px 1px #0d0d0d;
border: 1px solid #000000;
height: 36px;
width: 16px;
border-radius: 3px;
background: #ffffff;
cursor: pointer;
}
input[type=range]:focus::-ms-fill-lower {
background: #3071a9;
}
input[type=range]:focus::-ms-fill-upper {
background: #367ebd;
}
<span>text</span>
<div>
<input type=range />
</div>
<span>text</span>
My web page looks good in all other browsers than IE. Here the thumb of my range sliders are "cut off".
My code is here:
https://jsfiddle.net/t1pw9rh2/
HTML:
<form action="url-link-here" method="post">
<span id="mydiv">100</span>
<input class="input-range" id="sizeID" onchange="test()" oninput="test()" type="range" name="size" value="100" min="5" max="250" step ="5">
</form>
CSS:
input[type=range] {
-webkit-appearance: none;
margin: 10px 0;
width: 100%;
}
input[type=range]:focus {
outline: none;
}
input[type=range]::-webkit-slider-runnable-track {
width: 100%;
height: 10px;
cursor: pointer;
animate: 0.2s;
box-shadow: 0px 0px 0px #000000;
background: #fff;
border-radius: 1px;
border: 1px solid #39404D;
}
input[type=range]::-webkit-slider-thumb {
box-shadow: 0px 0px 0px #000000;
border: 1px solid #39404D;
height: 28px;
width: 16px;
border-radius: 2px;
background: #fff;
cursor: pointer;
-webkit-appearance: none;
margin-top: -10px;
}
input[type=range]:focus::-webkit-slider-runnable-track {
background: #fff;
}
input[type=range]::-moz-range-track {
width: 100%;
height: 10px;
cursor: pointer;
animate: 0.2s;
box-shadow: 0px 0px 0px #000000;
background: #fff;
border-radius: 1px;
border: 1px solid #39404D;
}
input[type=range]::-moz-range-thumb {
box-shadow: 0px 0px 0px #000000;
border: 1px solid #39404D;
height: 28px;
width: 16px;
border-radius: 2px;
background: #fff;
cursor: pointer;
}
input[type=range]::-ms-track {
width: 100%;
height: 10px;
cursor: pointer;
animate: 0.2s;
background: transparent;
border-color: transparent;
color: transparent;
}
input[type=range]::-ms-fill-lower {
background: #fff;
border: 1px solid #39404D;
border-radius: 4px;
box-shadow: 0px 0px 0px #000000;
}
input[type=range]::-ms-fill-upper {
background: #fff;
border: 1px solid #39404D;
border-radius: 4px;
box-shadow: 0px 0px 0px #000000;
}
input[type=range]::-ms-thumb {
box-shadow: 0px 0px 0px #000000;
border: 1px solid #39404D;
height: 28px;
width: 16px;
border-radius: 2px;
background: #fff;
cursor: pointer;
}
input[type=range]:focus::-ms-fill-lower {
background: #fff;
}
input[type=range]:focus::-ms-fill-upper {
background: #fff;
}
Javascript:
function test(){
var myDivElem = document.getElementById("mydiv");
var sizerange= document.getElementById("sizeID");
myDivElem.innerHTML = sizerange.value;
}
My web page can be seen here:
http://negoto.azurewebsites.net/
How do I fix the css so the thumb looks good in IE?
Best, Peter
I found the answer here. http://brennaobrien.com/blog/2014/05/style-input-type-range-in-every-browser.html
It mentions you cant style the thumb bigger than the track in IE.
When we use input range <input type="range", there is a handler which is moveable as how we handle it.
Now I need a help how to customize this handle, in this case I want to change the default handler with my own handler(image of button).
Thanks for the help
<input type='range'/>
Use the following to style the base:
input[type=range] {
-webkit-appearance: none; /* Hides the slider so that custom slider can be made */
width: 100%; /* Specific width is required for Firefox. */
}
input[type=range]::-webkit-slider-thumb {
-webkit-appearance: none;
}
input[type=range]:focus {
outline: none; /* Removes the blue border. You should probably do some kind of focus styling for accessibility reasons though. */
}
input[type=range]::-ms-track {
width: 100%;
cursor: pointer;
background: transparent; /* Hides the slider so custom styles can be added */
border-color: transparent;
color: transparent;
}
Use the following to style the thumb:
/* Special styling for WebKit/Blink */
input[type=range]::-webkit-slider-thumb {
-webkit-appearance: none;
border: 1px solid #000000;
height: 36px;
width: 16px;
border-radius: 3px;
background: #ffffff;
cursor: pointer;
margin-top: -14px; /* You need to specify a margin in Chrome, but in Firefox and IE it is automatic */
box-shadow: 1px 1px 1px #000000, 0px 0px 1px #0d0d0d; /* Add cool effects to your sliders! */
}
/* All the same stuff for Firefox */
input[type=range]::-moz-range-thumb {
box-shadow: 1px 1px 1px #000000, 0px 0px 1px #0d0d0d;
border: 1px solid #000000;
height: 36px;
width: 16px;
border-radius: 3px;
background: #ffffff;
cursor: pointer;
}
/* All the same stuff for IE */
input[type=range]::-ms-thumb {
box-shadow: 1px 1px 1px #000000, 0px 0px 1px #0d0d0d;
border: 1px solid #000000;
height: 36px;
width: 16px;
border-radius: 3px;
background: #ffffff;
cursor: pointer;
}
Snippet:
input[type=range] {
-webkit-appearance: none;
margin: 10px 0;
width: 100%;
}
input[type=range]:focus {
outline: none;
}
input[type=range]::-webkit-slider-runnable-track {
width: 100%;
height: 12.8px;
cursor: pointer;
animate: 0.2s;
box-shadow: 0px 0px 0px #000000, 0px 0px 0px #0d0d0d;
background: #ac51b5;
border-radius: 25px;
border: 0px solid #000101;
}
input[type=range]::-webkit-slider-thumb {
box-shadow: 0px 0px 0px #000000, 0px 0px 0px #0d0d0d;
border: 0px solid #000000;
height: 20px;
width: 39px;
border-radius: 7px;
background: #65001c;
cursor: pointer;
-webkit-appearance: none;
margin-top: -3.6px;
}
input[type=range]:focus::-webkit-slider-runnable-track {
background: #ac51b5;
}
input[type=range]::-moz-range-track {
width: 100%;
height: 12.8px;
cursor: pointer;
animate: 0.2s;
box-shadow: 0px 0px 0px #000000, 0px 0px 0px #0d0d0d;
background: #ac51b5;
border-radius: 25px;
border: 0px solid #000101;
}
input[type=range]::-moz-range-thumb {
box-shadow: 0px 0px 0px #000000, 0px 0px 0px #0d0d0d;
border: 0px solid #000000;
height: 20px;
width: 39px;
border-radius: 7px;
background: #65001c;
cursor: pointer;
}
input[type=range]::-ms-track {
width: 100%;
height: 12.8px;
cursor: pointer;
animate: 0.2s;
background: transparent;
border-color: transparent;
border-width: 39px 0;
color: transparent;
}
input[type=range]::-ms-fill-lower {
background: #ac51b5;
border: 0px solid #000101;
border-radius: 50px;
box-shadow: 0px 0px 0px #000000, 0px 0px 0px #0d0d0d;
}
input[type=range]::-ms-fill-upper {
background: #ac51b5;
border: 0px solid #000101;
border-radius: 50px;
box-shadow: 0px 0px 0px #000000, 0px 0px 0px #0d0d0d;
}
input[type=range]::-ms-thumb {
box-shadow: 0px 0px 0px #000000, 0px 0px 0px #0d0d0d;
border: 0px solid #000000;
height: 20px;
width: 39px;
border-radius: 7px;
background: #65001c;
cursor: pointer;
}
input[type=range]:focus::-ms-fill-lower {
background: #ac51b5;
}
input[type=range]:focus::-ms-fill-upper {
background: #ac51b5;
}
body {
padding: 30px;
}
<input type="range" />
Reference: Styling Cross-Browser Compatible Range Inputs with CSS