如所解释这里,IE允许下部和上部的填充或轨道区域的样式在CSS如下:
/* The following only affects the range input in IE */
input[type="range"]::-ms-fill-lower {
background-color: red;
}
input[type="range"]::-ms-fill-upper {
background-color: blue;
}Run Code Online (Sandbox Code Playgroud)
<input type="range">Run Code Online (Sandbox Code Playgroud)
有没有人知道如何使用CSS或任何JS库将不同的样式应用于Firefox,Chrome等中的范围输入的上下轨道?
更新:
正如Wilson F所指出的,Firefox现在支持这一点:
/* The following only affects the range input in FF */
input[type="range"]::-moz-range-progress {
background-color: red;
}
input[type="range"]::-moz-range-track {
background-color: blue;
}Run Code Online (Sandbox Code Playgroud)
<input type="range"> Run Code Online (Sandbox Code Playgroud)