JSFiddle - React, Tailwind, and code Playground
HTML
<div class="calculator">
<form action="">
<div class="control">
<div class="horizontal-wrapper">
<input class="control__slider" id="input-range-year" type="range" min="1" max="40" value="30" step="1">
<input class="control__input" type="number" value="30">
</div>
</div>
<div class="control">
<div class="horizontal-wrapper">
<input class="control__slider" id="input-range-year" type="range" min="1" max="40" value="30" step="1">
<input class="control__input" type="number" value="30">
</div>
</div>
</form>
</div>
CSS
html {
box-sizing: border-box;
font-size: 16px;
}
*,
*:before,
*:after {
box-sizing: inherit;
}
input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
-webkit-appearance: none;
margin: 0;
}
input[type="range"]:focus {
outline: none;
}
input[type="range"] {
margin: auto;
-webkit-appearance: none;
position: relative;
overflow: hidden;
height: 0.66em;
width: 100%;
cursor: pointer;
border-radius: 0;
/* iOS */
}
::-webkit-slider-runnable-track {
background: #ddd;
}
::-webkit-slider-thumb {
-webkit-appearance: none;
width: 20px;
/* 1 */
height: 40px;
background: #fff;
box-shadow: -100vw 0 0 100vw dodgerblue;
border: 2px solid #999;
/* 1 */
}
::-moz-range-track {
height: 0.25em;
background: #ddd;
}
::-moz-range-thumb {
background: #fff;
height: 40px;
width: 20px;
border: 3px solid #999;
border-radius: 0 !important;
box-shadow: -100vw 0 0 100vw dodgerblue;
box-sizing: border-box;
}
::-ms-fill-lower {
background: dodgerblue;
}
::-ms-thumb {
background: #fff;
border: 2px solid #999;
height: 40px;
width: 20px;
box-sizing: border-box;
}
::-ms-ticks-after {
display: none;
}
::-ms-ticks-before {
display: none;
}
::-ms-track {
background: #ddd;
color: transparent;
height: 0.25em;
border: none;
}
::-ms-tooltip {
display: none;
}
body,
h1,
h2,
h3,
h4,
h5,
h6,
p,
ol,
ul {
margin: 0;
padding: 0;
}
header,
.calculator {
font-size: 1rem;
}
.calculator {
font-size: 0.75em;
margin-top: 1.3125em;
border-radius: 4px;
box-shadow: 0 2px 6px 2px rgba(0, 0, 0, 0.1);
padding: 1.25em;
}
.horizontal-wrapper {
display: flex;
align-items: center;
}
.control__input {
width: 3.25em;
height: 2.5em;
}
.control__slider {
width: 100%;
}
.control__min-val,
control__max-val {
width: 1.3125em;
}