input type=range style
by uemon
HTML
<input type="range" min="0" max="100">
CSS
body{background:#000}
input[type=range] {
-webkit-appearance: none;
margin: 0;
width: 100%;
background-color:transparent;
padding: 0;
}
input[type=range]:focus {
outline: none;
}
/* WebKit・Blink向け 溝のスタイル */
input[type=range]::-webkit-slider-runnable-track {
width: 100%;
height: 5px;
cursor: pointer;
animate: 0.2s;
/*box-shadow: 1px 1px 1px #000000, 0px 0px 1px #0d0d0d;*/
background: #cccccc;
/*border-radius: 1.3px;*/
/*border: 1px solid #010101;*/
}
/* WebKit・Blink向け つまみのスタイル */
input[type=range]::-webkit-slider-thumb {
/*box-shadow: 1px 1px 1px #666, 0px 0px 1px #0d0d0d;*/
border: 1px solid #666;
height: 15px;
width: 15px;
border-radius: 50%;
background: #ffffff;
cursor: pointer;
-webkit-appearance: none;
/* 以下は つまみの縦位置調整 */
margin-top: -5px; /* (つまみの高さ - トラックの高さ) / 2 。つまみの高さは border を含む */
}
/* 何故か上の margin-top 指定が Edge に効いてしまうので、Edge向けに設定をリセット */
@supports (-ms-ime-align: auto) {
input[type=range]::-webkit-slider-thumb {
margin-top: 0 !important;
}
}
/* WebKit・Blink向け focus時のスタイル */
input[type=range]:focus::-webkit-slider-runnable-track {
background: #999999;
}
/* Firefox向け 溝のスタイル */
input[type=range]::-moz-range-track {
width: 100%;
height: 5px;
cursor: pointer;
animate: 0.2s;
/*box-shadow: 1px 1px 1px #000000, 0px 0px 1px #0d0d0d;*/
background: #cccccc;
/*border-radius: 1.3px;
border: 0.2px solid #010101;*/
}
/* Firefox向け つまみのスタイル */
input[type=range]::-moz-range-thumb {
/*box-shadow: 1px 1px 1px #666, 0px 0px 1px #0d0d0d;*/
border: 1px solid #666;
height: 15px;
width: 15px;
border-radius: 50%;
background: #ffffff;
cursor: pointer;
}
/* Edge・IE向け 溝のスタイル */
input[type=range]::-ms-track {
width: 100%;
height: 5px;
cursor: pointer;
animate: 0.2s;
background: transparent;
border-color: transparent;
border-width: 16px 0;
color: transparent;
}
/* Edge・IE向け 溝の色(つまみより左側) */
input[type=range]::-ms-fill-lower {
background: #5bc0de;
border: 0.2px solid...