<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Input Range Slider</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<div>
<span id="rangeValue">0</span>
<Input class="range" type="range" name "" value="0" min="0" max="1000" onChange="rangeSlide(this.value)" onmousemove="rangeSlide(this.value)"></Input>
</div>
<script type="text/javascript">
function rangeSlide(value) {
document.getElementById('rangeValue').innerHTML = value;
}
</script>
</body>
</html>
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300&display=swap');
* {
margin: 0;
padding: 0;
font-family: "Poppins", sans-serif;
}
body {
display: flex;
justify-content: center;
align-items: center;
min-height: 100vh;
background: #151515;
}
div {
position: absolute;
}
#rangeValue {
position: relative;
display: block;
text-align: center;
font-size: 6em;
color: #999;
font-weight: 400;
}
.range {
width: 400px;
height: 15px;
-webkit-appearance: none;
background: #111;
outline: none;
border-radius: 15px;
overflow: hidden;
box-shadow: inset 0 0 5px rgba(0, 0, 0, 1);
}
.range::-webkit-slider-thumb {
-webkit-appearance: none;
width: 15px;
height: 15px;
border-radius: 50%;
background: #00fd0a;
cursor: pointer;
border: 4px solid #333;
box-shadow: -407px 0 0 400px #00fd0a;
}
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.