Stylish Range Slider using CSS
HTML
CSS
JS
function range(value)
{
document.getElementById('value').innerHTML=value;
}
{
document.getElementById('value').innerHTML=value;
}
<div class=box>
<center>
<br><br><br>
<span id=value>300</span>
<br><br><br>
<input type=range value=300 min=0 max=1000 onChange=range(this.value) class=bar onmousemove=range(this.value) >
</center>
</div>
<style>
.box
{
background-color:black;
position:relative;
width:100%;
height:280px;
}
#value
{
display: block;
position:relative;
font-size:6em;
color:#999;
text-align: center;
font-weight:400;
}
.bar
{
width:75%;
height:15px;
-webkit-appearance:none;
background:#333;
border-radius:15px;
position:relative;
display:block;
outline:none;
overflow:hidden;
}
.bar::-webkit-slider-thumb
{
-webkit-appearance:none;
background:#00fd00;
width:15px;
height:15px;
border-radius:50%;
pointer:cursor;
box-shadow:-407px 0 0 400px #00fd00;
border:3px solid #333;
}
</style>
<center>
<br><br><br>
<span id=value>300</span>
<br><br><br>
<input type=range value=300 min=0 max=1000 onChange=range(this.value) class=bar onmousemove=range(this.value) >
</center>
</div>
<style>
.box
{
background-color:black;
position:relative;
width:100%;
height:280px;
}
#value
{
display: block;
position:relative;
font-size:6em;
color:#999;
text-align: center;
font-weight:400;
}
.bar
{
width:75%;
height:15px;
-webkit-appearance:none;
background:#333;
border-radius:15px;
position:relative;
display:block;
outline:none;
overflow:hidden;
}
.bar::-webkit-slider-thumb
{
-webkit-appearance:none;
background:#00fd00;
width:15px;
height:15px;
border-radius:50%;
pointer:cursor;
box-shadow:-407px 0 0 400px #00fd00;
border:3px solid #333;
}
</style>
Comments
Post a Comment