Template for a stylized range input slider.
See this article for details on styling options.
Template for a stylized range input slider.
See this article for details on styling options.
<!DOCTYPE html> | |
<meta charset="utf-8"> | |
<style> | |
output { | |
font-family: 'Helvetica Neue'; | |
font-weight: 300; | |
font-size: 40px; | |
color: #777; | |
} | |
input[type=range] { | |
-webkit-appearance: none; | |
background-color: #C8C8C8; | |
width: 500px; | |
height: 25px; | |
margin: 20px; | |
} | |
::-webkit-slider-thumb { | |
-webkit-appearance: none; | |
background-color: #777; | |
width: 30px; | |
height: 25px; | |
} | |
</style> | |
<body> | |
<input type=range id=slider min=1 max=2000 value=1 step=1> | |
<output for=slider id=current>1</output> | |
<script> | |
setOutput = function() { | |
return current.value = slider.value; | |
}; | |
slider.addEventListener('input', setOutput); | |
</script> |