1

スライダーの色を変更するにはどうすればよいですか

<input type="range" id="input">

color、bg-color、background-color は既に試しましたが、変わりません...

アップデート:

JavaScriptで変更したいです。このようなもの:

document.getElementById("input").style.background-color = "000000";
4

1 に答える 1

7

これを試して:

input[type=range] {
    -webkit-appearance: none;
    background-color: silver;
    width: 200px;
    height:20px;
}

input[type="range"]::-webkit-slider-thumb {
     -webkit-appearance: none;
    background-color: #666;
    opacity: 0.5;
    width: 10px;
    height: 26px;
}

document.getElementById("input").style.backgroundColor = '#000000';

jsfiddle

于 2013-08-28T16:40:35.810 に答える