【发布时间】:2011-03-03 08:51:25
【问题描述】:
我想根据滑块位置为滑块提供两种不同颜色的颜色。一种颜色应该在滑块之前,另一种颜色应该在滑块之后。我使用 css 实现了其他设计。这是为输入[type=range]设置皮肤的代码。
input[type=range]{
border: 1px solid #4ba8b1;
margin: 0px 0px 5px 5px;
background:-webkit-gradient(linear,center top, center bottom, from(#CFDCDD),to(#DFE9EA),color-stop(50%,#DFE9EA));
float:left;
pointer:cursor;
-webkit-appearance:none;
width:300px;
height:5px;
-webkit-border-radius:5px;
-moz-border-radius:5px;
}
input[type=range]::-webkit-slider-thumb
{
-webkit-appearance:none;
border:1px solid #4ba8b1;
background:-webkit-gradient(linear,center top, center bottom,from(#CAE8E9),to(#E4ECEC),color-stop(50%,#9ED2D1));
background:-moz-linear-gradient(top,#CAE8E9,#9ED2D1,#E4ECEC);
width:7px;
height:15px;
opacity:.7;
}
html 是:
<input type="range" name="rangeEl" value="120" min="0" max="150" />
它使用单一背景颜色很好地呈现输出。现在我需要为拇指之前的滑块和拇指之后的另一种颜色提供颜色。帮我!
【问题讨论】:
-
这在当前状态下太模糊了。您能否重新措辞一下以更清楚地说明您想要什么以及您的问题到底是什么?然而,滑块控件在纯 CSS 中是不可行的
-
我希望你现在明白我的问题..
标签: css