Home >Web Front-end >CSS Tutorial >How Can I Customize the Appearance of HTML5 Range Input Sliders in Different Browsers?
Coloring HTML5 Range Input Sliders for WebKit
WebKit-based browsers display a native range input slider with a consistent appearance. However, adding custom styling to modify the appearance of this slider can be challenging.
For Chrome:
For IE and Firefox (Native Support):
CSS Code Implementation:
/* Chrome */ @media screen and (-webkit-min-device-pixel-ratio:0) { input[type='range'] { overflow: hidden; width: 80px; -webkit-appearance: none; background-color: #9a905d; } input[type='range']::-webkit-slider-runnable-track { height: 10px; -webkit-appearance: none; color: #13bba4; margin-top: -1px; } input[type='range']::-webkit-slider-thumb { width: 10px; -webkit-appearance: none; height: 10px; cursor: ew-resize; background: #434343; box-shadow: -80px 0 0 80px #43e5f7; } } /* Firefox */ input[type="range"]::-moz-range-progress { background-color: #43e5f7; } input[type="range"]::-moz-range-track { background-color: #9a905d; } /* IE */ input[type="range"]::-ms-fill-lower { background-color: #43e5f7; } input[type="range"]::-ms-fill-upper { background-color: #9a905d; }
HTML Example:
<input type="range"/>
The above is the detailed content of How Can I Customize the Appearance of HTML5 Range Input Sliders in Different Browsers?. For more information, please follow other related articles on the PHP Chinese website!