How to display value inside the Range Slider? - css

range slider design
Hello,
I need help creating this range slider. I need the value to be displayed on or inside the slider, not on a tooltip or bubble over it. And the left side with a different color than the right side.
I have found a way to make the value on the slider but can't apply any style on it!
Any help is very appreciated.
Thank you!

$("document").ready(function() {
$(".slider").rangeslider();
});
$.fn.rangeslider = function(options) {
this.each(function(i, elem) {
var obj = $(elem); // input element
var defautValue = obj.attr("value");
var slider_max = (obj.attr("max"));
var slider_min = (obj.attr("min"));
var slider_step = (obj.attr("step"));
var slider_stop = (slider_max - slider_min) / slider_step;
var step_percentage = 100 / slider_stop;
console.log(step_percentage);
var color = "";
var classlist = obj.attr("class").split(/\s+/);
$.each(classlist, function(index, item) {
if (item.startsWith('slider-')) {
color = item;
}
});
if (color == "") {
color = "slider-blue";
}
if (slider_stop <= 30) {
var i;
var dots = "";
for (i = 1; i < slider_stop; i++) {
dots += "<div class='dot' id='" + i + "' style='left:" + step_percentage * i + "%;'></div>";
}
} else {
var dots = "";
}
obj.wrap("<span class='slider " + color + "'></span>");
obj.after("<span class='slider-container " + color + "'><span class='bar'><span></span>" + dots + "</span><span class='bar-btn'><span>0</span></span></span>");
obj.attr("oninput", "updateSlider(this)");
updateSlider(this);
return obj;
});
};
function updateSlider(passObj) {
var obj = $(passObj);
var value = obj.val();
var min = obj.attr("min");
var max = obj.attr("max");
var range = Math.round(max - min);
var percentage = Math.round((value - min) * 100 / range);
var nextObj = obj.next();
var btn = nextObj.find("span.bar-btn");
if (value == min) {
nextObj.find("span.bar-btn").css("left", percentage + "%");
} else if (value == max) {
nextObj.find("span.bar-btn").css("left", "calc(" + percentage + "% - " + btn.width() + "px");
} else {
nextObj.find("span.bar-btn").css("left", "calc(" + percentage + "% - " + btn.width() / 2 + "px");
}
nextObj.find("span.bar > span").css("width", percentage + "%");
nextObj.find("span.bar-btn > span").text(value);
};
body {
font-family: Calibri;
background-image: linear-gradient(90deg, #691337, #613374, #133742);
}
.heading {
text-align: center;
color: #fff;
}
.wrap {
margin: 25px;
background: #133742;
border-radius: 7.5px;
padding: 5px 0px 20px 53px;
}
/* SLIDER-STYLES */
.slider-orange>.bar>span {
transition: 0.3s;
background: #ff821e!important;
}
.slider-orange>.bar-btn {
background: #ff821e!important;
border: 2px solid #ffbf8c !important;
transition: 0.3s;
}
.slider-orange:hover>input+.slider-container>.bar-btn {
box-shadow: inset 0 0 2px #ff821e;
color: #ff821e;
background: #fff !important;
border: 2px solid #ff821e !important;
}
.slider-red>.bar>span {
transition: 0.3s;
background: #eb0041!important;
}
.slider-red>.bar-btn {
background: #eb0041!important;
border: 2px solid #f9b2c6 !important;
transition: 0.3s;
}
.slider-red:hover>input+.slider-container>.bar-btn {
box-shadow: inset 0 0 2px #eb0041;
color: #eb0041;
background: #fff !important;
border: 2px solid #eb0041 !important;
}
.slider-green>.bar>span {
transition: 0.3s;
background: #00965a!important;
}
.slider-green>.bar-btn {
background: #00965a!important;
border: 2px solid #b2dfcd !important;
transition: 0.3s;
}
.slider-green:hover>input+.slider-container>.bar-btn {
box-shadow: inset 0 0 2px #00965a;
color: #00965a;
background: #fff !important;
border: 2px solid #00965a !important;
}
.slider-yellow>.bar>span {
transition: 0.3s;
background: #ffd200!important;
}
.slider-yellow>.bar-btn {
background: #ffd200!important;
border: 2px solid #fff1b2 !important;
transition: 0.3s;
}
.slider-yellow:hover>input+.slider-container>.bar-btn {
box-shadow: inset 0 0 2px #ffd200;
color: #1d1d1b;
background: #fff !important;
border: 2px solid #ffd200 !important;
}
.slider-cyan>.bar>span {
transition: 0.3s;
background: #00b4e6!important;
}
.slider-cyan>.bar-btn {
background: #00b4e6!important;
border: 2px solid #b2e8f7 !important;
transition: 0.3s;
}
.slider-cyan:hover>input+.slider-container>.bar-btn {
box-shadow: inset 0 0 2px #00b4e6;
color: #00b4e6;
background: #fff !important;
border: 2px solid #00b4e6 !important;
}
.slider-blue>.bar>span {
transition: 0.3s;
background: #0014a0!important;
}
.slider-blue>.bar-btn {
background: #0014a0!important;
border: 2px solid #0014a0 !important;
transition: 0.3s;
}
.slider-blue:hover>input+.slider-container>.bar-btn {
box-shadow: inset 0 0 2px #0014a0;
color: #0014a0;
background: #fff !important;
border: 2px solid #0014a0 !important;
}
.dot {
width: 7px !important;
height: 7px;
background: #fff;
display: block;
position: absolute;
border-radius: 125%;
top: 2px;
}
.slider {
display: inline-block;
width: 100%;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
position: relative;
}
.slider>input {
opacity: 0;
width: 100%;
height: 40px;
position: relative;
z-index: 5;
-webkit-appearance: none;
}
.slider>input::-webkit-slider-thumb {
-webkit-appearance: none;
z-index: 100;
position: relative;
width: 50px;
height: 30px;
-webkit-border-radius: 10px;
}
.slider>span.slider-container {
min-height: 40px;
display: inline-block;
position: absolute;
top: 0;
left: -8px;
right: 46px;
z-index: 3;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
.slider>span.slider-container>span.bar {
background-color: #dadada;
display: inline-block;
position: absolute;
z-index: 1;
left: 0;
right: 0;
height: 11px;
overflow: hidden;
-webkit-border-radius: 10px;
-moz-border-radius: 10px;
border-radius: 10px;
top: 50%;
transform: translateY(-50%);
}
.slider>span.slider-container>span.bar>span {
background: #00965b;
display: inline-block;
float: left;
height: 11px;
width: 0%;
}
.slider>span.slider-container>span.bar-btn {
display: inline-block;
position: absolute;
min-width: 55px;
max-width: 100px;
height: 32px;
font-weight: bold;
text-align: center;
background: #00965b;
left: 0;
top: 50%;
border-radius: 100px;
border: 2px solid #dadada;
z-index: 5;
color: #fff;
-webkit-touch-callout: none;
-webkit-user-select: none;
-khtml-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
transform: translateY(-50%);
}
.slider>span.slider-container>span.bar-btn>span {
position: relative;
position: absolute;
tlef: 50%;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
}
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<div class="wrap">
<h1 class="heading">Simple Rangeslider</h1>
<input class="slider" value="0" min="3" max="5" step="1" name="001" type="range" />
<input class="slider slider-orange" value="0" min="0" max="25" step="1" name="002" type="range" />
<input class="slider slider-red" value="3556" min="0" max="3556" step="34" name="003" type="range" />
<input class="slider slider-green" value="0" min="0" max="34" step="4" name="004" type="range" />
<input class="slider slider-yellow" value="0" min="0" max="5" step="1" name="005" type="range" />
<input class="slider slider-cyan" value="5" min="0" max="100" step="2" name="006" type="range" />
<input class="slider slider-blue" value="0" min="0" max="5" step="1" name="007" type="range" />
</div>
HI go through this if need any kind of customization in range slider.
Source Codepen

Related

Floating labels - label above input field

I'm working on an existing form, where I want to introduce floating labels.
A lot of the solutions I have seen on stack overflow are great, but require the label tag, to sit directly underneath the <input> tag. For example here.
On the form I'm working on though, my label tag, sits above the <input> tag. And the input tag, sits in a seperate div. (I am not allowed to move these tags around - please don't ask, restriction of the application!).
Is there anyway, I can achieve floating CSS labels, with this structure?
.test-field {
clear: both;
margin-bottom: 20px;
position: relative;
}
.test-field__input {
font-size: 0.875em;
line-height: 1;
-moz-appearance: none;
-webkit-appearance: none;
background-color: #f5f5f5;
border: 2px solid #eee;
border-radius: 4px;
color: grey;
height: calc((40 / 14) * 1em);
line-height: 1;
outline: 0;
padding: 0 8px;
vertical-align: top;
width: 100%;
}
/* // FOCUS */
.test-field__input:focus,
.test-field__input ~ input:checked:focus {
border-color: #5d7199;
}
/* // DISABLED */
.test-field--disabled .test-field__input {
background-color: #e8e8e3;
cursor: not-allowed;
}
.test-field--disabled .test-field__flag, .test-field--disabled .test-field__label {
color: #d0d0cb;
}
/* // ERROR */
.test-field--error .test-field__input, .test-field--error .test-field__selection .atc-field__input {
border-color: #ff4436;
color: #ff4436;
}
/* // FLOATING LABEL */
.test-field--floating .test-field-input {
position: relative;
margin-bottom: 1.5rem;
}
.test-field__label {
position: absolute;
top: 0;
padding: 7px 0 0 13px;
transition: all 200ms;
opacity: 0.5;
}
.test-field__input:focus + .test-field__label,
.test-field--floating .test-field__input:valid + .test-field__label {
font-size: 75%;
transform: translate3d(0, -100%, 0);
opacity: 1;
}
<div class="test-field test-field--floating">
<label for="a" class="test-field__label">Input label</label>
<input class="test-field__input" id="b" type="text" value="" required>
</div>
This seemed to be a good way to replicate floating labels, with a similar DOM structure:
const floatField = document.querySelectorAll('.ej-form-field-input-textbox');
const floatContainer = document.querySelectorAll('.ej-form-field');
for (let i = 0; i < floatField.length; i++) {
floatField[i].addEventListener('focus', () => {
floatContainer[i].classList.add('active');
});
};
for (let i = 0; i < floatField.length; i++) {
floatField[i].addEventListener('blur', () => {
floatContainer[i].classList.remove('active');
});
};
.ej-form-field {
border: solid 1px #ccc;
padding: 0 8px;
position: relative;
}
.ej-form-field input {
border: 1px solid red;
font-size: 16px;
outline: 0;
height: 30px;
/* padding: 16px 0 10px; */
}
label {
font-size: 16px;
position: absolute;
transform-origin: top left;
transform: translate(0, 16px) scale(1);
transition: all .1s ease-in-out;
height: 40px;
}
.ej-form-field.active label {
transform: translate(0, -6px) scale(.95);
color: red;
margin-left: 10px;
background-color: #fff;
border: 1px solid green;
height: 20px;
}
<div id="floatContainer" class="ej-form-field">
<label for="floatField">First name</label>
<div>
<input id="floatField" class="ej-form-field-input-textbox" type="text">
</div>
</div>
<div id="floatContainer" class="ej-form-field">
<label for="floatField">Last name</label>
<div>
<input id="floatField" class="ej-form-field-input-textbox" type="text">
</div>
</div>

input[type=radio]:before radio sticking out

The rounded edge is just sticking out of the square or circle so if I give before a white background the radio edge is still slightly visible.
input[type=radio] {
box-sizing: border-box;
margin: 0;
padding: 0;
position: relative;
cursor: pointer;
}
input[type=radio]:before {
content: "";
display: block;
width: 16px;
height: 16px;
border: 2px solid grey;
border-radius: 50%;
/* background-color: white; */
position: absolute;
top: 0;
left: 0;
}
> <input type="radio" name="r" checked>
How can I hide the radio button completely using css before?
I think using visibility:hidden may help, please check below :
input[type=radio] {
box-sizing: border-box;
margin: 0;
padding: 0;
position: relative;
cursor: pointer;
visibility: hidden;
}
input[type=radio]:before {
content: "";
display: block;
width: 16px;
height: 16px;
border: 2px solid grey;
border-radius: 50%;
/* background-color: white; */
position: absolute;
top: 0;
left: 0;
visibility: visible;
}
input[type=radio]:checked:after {
content: "";
display: block;
width: 10px;
height: 10px;
/* border: 2px solid green; */
border-radius: 50%;
background-color: green;
position: absolute;
top: 5px;
left: 5px;
visibility: visible;
}
<input type="radio" name="r" checked>
Here I've tried another way to do this by adding a span. Give it a try.
.customRadio {
position: relative;
}
input[type="radio"] {
opacity: 0;
margin: 0 5px 0 0;
transition: all 0.2s ease 0s;
}
input[type="radio"] + .radioSpan {
background-color: transparent;
border: 1px solid #aaaaaa;
border-radius: 50%;
content: "";
height: 17px;
left: 0;
position: absolute;
top: 2px;
width: 17px;
transition: all 0.3s ease 0s;
}
input[type="radio"]:focus + .radioSpan,
input[type="radio"]:active + .radioSpan {
box-shadow: 0 3px 5px 0 rgba(56, 49, 132, 0.5) !important;
}
input[type="radio"]:checked + .radioSpan {
background-color: #408BF9;
border: 1px solid transparent;
}
input[type="radio"]:checked + .radioSpan::before {
background-color: #ffffff;
border-radius: 50%;
bottom: 0;
content: "";
height: 9px;
left: 0;
margin: auto;
position: absolute;
right: 0;
top: 0;
width: 9px;
z-index: 1;
}
input[type="radio"] ~ .radioText {
display: inline-block;
font-family: 'Roboto', sans-serif;
margin-left: 5px;
text-transform: capitalize;
}
<label class="customRadio">
<input type="radio"name="reportType" value="unsigned-report"/>
<span class="radioSpan"></span>
<span class="radioText">UnSigned Report</span>
</label>
Kindly find following solution:
HTML:
<div class="radio">
<input type="radio" name="r" checked>
</div>
CSS:
.radio {
box-sizing: border-box;
margin: 0;
padding: 0;
position: relative;
cursor: pointer;
}
.radio::before {
content: "";
visibility: hidden; // option-1
/* opacity: 0; // option-2 */
/* display: none; //option-3 */
}

HTML5 slider bar's thumb can't cover the track

I made a slider bar with html5 & css, like this.
function showValue(value) {
document.getElementById("range").innerHTML = value;
}
.c-zoombar {
-webkit-appearance: none;
background: none;
outline: none;
overflow: hidden;
width: 200px;
height: 20px;
}
.c-zoombar::-webkit-slider-thumb {
-webkit-appearance: none;
background: #5e6fd9;
border: 1px solid #fff;
border-radius: 50%;
height: 12px;
position: relative;
top: -5.5px;
transition: .2s;
width: 12px;
}
.c-zoombar::-webkit-slider-runnable-track {
background: transparent;
border: 1px solid #000;
border-radius: 2px;
cursor: pointer;
height: 3px;
width: 100%;
}
.c-zoombar:active::-webkit-slider-thumb {
height: 16px;
top: -8px;
width: 16px;
}
.c-zoombar::-webkit-slider-thumb:hover {
height: 16px;
top: -8px;
width: 16px;
}
<div>
<input type="range" value="0" class="c-zoombar" onInput="showValue(this.value)" />
</div>
<div>
<span id="range">0</span>
</div>
However, when I scroll the thumb to the most right/left, the thumb can't totally cover the track, as you can see in the following image.
What should I modify to make the thumb be able to cover the track when scrolling to the most right/left? Thank you.
I found the transform: scale() could do the part of trick (also scale transitioned more smoothly then width/height). is that 12px size is mandatory?
function showValue(value) {
document.getElementById("range").innerHTML = value;
}
.c-zoombar {
-webkit-appearance: none;
background: none;
outline: none;
overflow: visible;
width: 200px;
height: 20px;
}
.c-zoombar::-webkit-slider-thumb {
-webkit-appearance: none;
background: #5e6fd9;
border: 1px solid #fff;
border-radius: 50%;
height: 12px;
position: relative;
top: -5.5px;
transition: .2s;
width: 12px;
transform: scale(1.33);
}
.c-zoombar::-webkit-slider-runnable-track {
background: transparent;
border: 1px solid #000;
border-radius: 2px;
cursor: pointer;
height: 3px;
width: 100%;
}
.c-zoombar:active::-webkit-slider-thumb,
.c-zoombar::-webkit-slider-thumb:hover {
transform: scale(1.66);
}
<div class='wrap'>
<input type="range" value="0" class="c-zoombar" onInput="showValue(this.value)" />
</div>
<div>
<span id="range">0</span>
</div>

Placeholder position when input has text

How to do placeholder styling when Input Text are focus, the placeholder are still visible and the font-size become smaller. For example like this:
I only need webkit support. Does webkit support such thing?
.input {
width: 200px;
height: 35px;
outline:0;
padding:0 10px;
}
.label { position: absolute;
pointer-events: none;
left: 20px;
top: 18px;
transition: 0.2s ease all;
}
input:focus ~ .label,
input:not(:focus):valid ~ .label{
top: 10px;
bottom: 5px;
left: 20px;
font-size: 12px;
}
<div>
<input type="text" class="input" required/>
<span class="label">Company Name</span>
</div>
You need to use a label element and modify it accordingly. Try this:
function fillClass() {
if ($(this).val() != '')
$(this).parent().addClass('input--filled');
else
$(this).parent().removeClass('input--filled');
}
$(".sign-in-input").focusout(fillClass);
.sign-in-input-ctr {
width: 100%;
display: inline-block;
vertical-align: top;
margin-bottom: 25px;
position: relative;
margin-top: 50px;
}
.sign-in-input {
width: 100%;
border: 2px solid transparent;
-webkit-transition: all 0.3s;
transition: all 0.3s;
height: 38px;
background-color: #fff;
outline: none;
border: 1px solid rgba(73, 73, 73, 0.2);
border-radius: 2px;
padding-left: 10px;
}
.sign-in-input:focus,
.input--filled .sign-in-input {
background-color: transparent;
border: 1px solid #a09e9e;
}
.sign-in-label {
width: 100%;
font-size: 12px;
position: absolute;
top: -18px;
pointer-events: none;
overflow: hidden;
padding: 0 15px;
left: 0;
-webkit-transform: translate3d(0, 30px, 0);
transform: translate3d(0, 30px, 0);
-webkit-transition: -webkit-transform 0.3s;
transition: transform 0.3s;
}
.sign-in-input:focus+.sign-in-label,
.input--filled .sign-in-label {
-webkit-transform: translate3d(-15px, 0, 0);
transform: translate3d(-15px, 0, 0);
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<div class="sign-in-input-ctr">
<input class="sign-in-input" type="text" name="email">
<label class="sign-in-label" for="signin-email"><span class="input-label-content">Email</span>
</label>
</div>
//------ contact us dropdown list
$(document).ready(function(){
$( ".form-group .form-control" ).focus(function() {
$(this).parent().addClass('inputFous');
}).blur(function() {
if($.trim($(this).val()) == '')
{
$(this).parent().removeClass('inputFous');
}
});
});
I think there is no webkit support for this, please check this code which will help you:- Jsfiddle

Styling input range for webkit with pure CSS

I would like to customize input type range like this.
I tried to use the following code to change the thumb and as below but selected range color is not changed.
HTML:
<input type="range" />
CSS:
input[type=range]::-webkit-slider-thumb {
-webkit-appearance: none;
height: 20px;
width: 20px;
border-radius: 10px;
background: red;
cursor: pointer;
border: none;
margin-top: -8px;
}
input[type=range] {
-webkit-appearance: none;
outline: 0;
margin: 0;
padding: 0;
height: 30px;
width: 100%;
}
Could anybody please suggest me to change the selected runnable track background color?
Interesting approach being used by the Ionic framework for styling the range input track with just CSS. They are adding a ::before pseudo-element to the ::-webkit-slider-thumb, making it as wide as possible and then positioning it on top of the track. (I couldn't get border-radius to work with it.)
input[type='range'] {
width: 210px;
height: 30px;
overflow: hidden;
cursor: pointer;
}
input[type='range'],
input[type='range']::-webkit-slider-runnable-track,
input[type='range']::-webkit-slider-thumb {
-webkit-appearance: none;
}
input[type='range']::-webkit-slider-runnable-track {
width: 200px;
height: 10px;
background: #AAA;
}
input[type='range']::-webkit-slider-thumb {
position: relative;
height: 30px;
width: 30px;
margin-top: -10px;
background: steelblue;
border-radius: 50%;
border: 2px solid white;
}
input[type='range']::-webkit-slider-thumb::before {
position: absolute;
content: '';
height: 10px; /* equal to height of runnable track */
width: 500px; /* make this bigger than the widest range input element */
left: -502px; /* this should be -2px - width */
top: 8px; /* don't change this */
background: #777;
}
<div class="container">
<input type="range" min="0" max="100" value="10" />
</div>
As far as I am aware there is no pure CSS way to do this for Webkit powered browsers (and FF). IE provides a way to style the two portions of the track using -ms-fill-lower and -ms-fill-upper but there are no equivalents in WebKit and hence JavaScript will be needed.
You could use a linear-gradient as background image for the runnable track and then change the background-size using JavaScript to achieve the required effect. As question is specific to Webkit, the snippet provided currently works only in Webkit powered browsers. This method does allow us to add a border-radius to the track.
This snippet was adapted from Ana Tudor's CodePen Demo. That demo has ways to make it work in other browsers also.
window.onload = function() {
var input = document.querySelector('input[type=range]'),
style_el = document.createElement('style'),
styles = [],
track_sel = ['::-webkit-slider-runnable-track'];
document.body.appendChild(style_el);
styles.push('');
input.addEventListener('input', function() {
var min = this.min || 0,
max = this.max || 100,
c_style, u, edge_w, val, str = '';
this.setAttribute('value', this.value);
val = this.value + '% 100%';
str += 'input[type="range"]' + track_sel[0] + '{background-size:' + val + '}';
styles[0] = str;
style_el.textContent = styles.join('');
}, false);
}
input[type='range'] {
width: 210px;
height: 50px;
cursor: pointer;
}
input[type='range'],
input[type='range']::-webkit-slider-runnable-track,
input[type='range']::-webkit-slider-thumb {
-webkit-appearance: none;
}
input[type='range']::-webkit-slider-runnable-track {
width: 200px;
height: 10px;
background: linear-gradient(to right, #777, #777), #AAA;
background-size: 10% 100%;
background-repeat: no-repeat;
border-radius: 5px;
}
input[type='range']::-webkit-slider-thumb {
height: 30px;
width: 30px;
margin-top: -10px;
background: steelblue;
border-radius: 50%;
border: 2px solid white;
}
<div class="container">
<input type="range" min="0" max="100" value="10" />
</div>
I got a solution that does not use a style tag but css variable:
const input = document.querySelector("input");
function setBackgroundSize(input) {
input.style.setProperty("--background-size", `${getBackgroundSize(input)}%`);
}
setBackgroundSize(input);
input.addEventListener("input", () => setBackgroundSize(input));
function getBackgroundSize(input) {
const min = +input.min || 0;
const max = +input.max || 100;
const value = +input.value;
const size = (value - min) / (max - min) * 100;
return size;
}
input[type='range'] {
width: 400px;
}
input[type='range'],
input[type='range']::-webkit-slider-runnable-track,
input[type='range']::-webkit-slider-thumb {
-webkit-appearance: none;
}
input[type='range']::-webkit-slider-runnable-track {
height: 3px;
background: linear-gradient(to right, #293043, #293043), #D7D7D7;
background-size: var(--background-size, 0%) 100%;
background-repeat: no-repeat;
border-radius: 5px;
}
input[type='range']::-webkit-slider-thumb {
width: 15px;
height: 15px;
cursor: pointer;
background: #293043;
border: solid white 1px;
border-radius: 50%;
margin-top: -6px;
box-shadow: 0px 1px 3px rgba(0, 0, 0, 0.4);
}
/** FF*/
input[type="range"]::-moz-range-progress {
background-color: #293043;
border-radius: 5px;
}
input[type="range"]::-moz-range-track {
background-color: #D7D7D7;
border-radius: 5px;
}
input[type="range"]::-moz-range-thumb {
width: 15px;
height: 15px;
cursor: pointer;
background: #293043;
border: solid white 1px;
border-radius: 50%;
margin-top: -6px;
box-shadow: 0px 1px 3px rgba(0, 0, 0, 0.4);
}
<input type="range" min="5" max="95" step="1" value="15">
This works on Chrome and Firefox :).

Resources