【发布时间】:2020-01-28 08:45:44
【问题描述】:
我有使用
样式的范围输入input[type=range] {
-webkit-appearance: none;
width: 100%;
background: transparent;
}
input[type=range]::-webkit-slider-runnable-track {
width: 100%;
height: 3px;
background: #2C65FF;
border-radius: 2px;
}
input[type=range]:focus::-webkit-slider-runnable-track {
background: #2C65FF;
}
input[type=range]::-moz-range-track {
width: 100%;
height: 3px;
background: #2C65FF;
border-radius: 2px;
}
input[type=range]::-webkit-slider-thumb {
-webkit-appearance: none;
height: 10px;
width: 10px;
background: white;
margin-top: -14px;
}
input[type=range]::-moz-range-thumb {
height: 10px;
width: 10px;
background: white;
}
当它们被禁用时,我想给它们一个“灰色”样式。
只是将:disabled 添加到每个具有深色背景的现有选择器上似乎没有任何作用。
如何设置禁用范围输入的样式?
【问题讨论】:
-
这不起作用?
input[type="range"]:disabled {可能需要引号。 -
在下面看到我的答案,它就是你要找的
标签: javascript html css css-selectors