Html
<div class="icon-num">
<input class="gradient" type="range" min="0" max="128" value="100" style="background-size: 80% 100%;" />
<input type="number" value="80" />
</div>
Css
<style>
.icon-num {
display: flex;
justify-items: center;
align-items: center;
width: 200px;
margin: 40px;
}
input {
-webkit-appearance: none;
border: none;
}
input:focus {
outline: none;
}
.gradient {
cursor: pointer;
width: 100%;
background: rgba(0, 0, 0, 0.04);
background: -webkit-linear-gradient(#0064ff, #0064ff) no-repeat, #ddd;
background-size: 0% 100%;
border-radius: 2px;
height: 4px;
}
.gradient::-webkit-slider-runnable-track {
width: 128px;
border-radius: 2px;
opacity: 1;
}
.gradient::-webkit-slider-thumb {
height: 12px;
width: 12px;
background: rgba(0, 100, 255, 1);
border-radius: 50%;
border: solid 1px rgba(0, 100, 255, 1);
}
input[type="number"] {
width: 56px;
height: 32px;
border-radius: 4px;
opacity: 1;
background: rgba(0, 0, 0, 0.04);
color: rgba(0, 0, 0, 0.9);
font-size: 14px;
font-weight: 400;
font-family: "PingFang SC";
text-align: center;
margin-left: 8px;
}
</style>
|