css - 输入范围有两种不同的背景颜色

标签 css html

<分区>

我希望我的输入类型的左侧部分:范围为#555555 并超过右侧的 slider 为#FFFFFF。

#seekslider {
    position: fixed;
    bottom: 30px;
    left: 0px;
    right: 0px;
    height: 5px;
    -webkit-appearance: none !important;
    background-color: #FFFFFF;
}
#seekslider::-webkit-slider-thumb {
    -webkit-appearance: none !important;
    background-color: #006CD0;
    height: 13px;
    width: 13px;
    border-radius: 100%;
    cursor: pointer;
}
<input id="seekslider" type="range" min="0.0" max="100.0" value="0" step="0.1">

最佳答案

#seekslider {
    position: fixed;
    bottom: 30px;
    left: 0px;
    right: 0px;
    height: 5px;
    -webkit-appearance: none !important;
    background-color: #FFFFFF;
}
#seekslider::-webkit-slider-thumb {
    -webkit-appearance: none !important;
    background-color: #006CD0;
    height: 13px;
    width: 13px;
    border-radius: 100%;
    cursor: pointer;
}
<input id="seekslider" type="range" min="0.0" max="100.0" value="0" step="0.1">

#seekslider {
    position: fixed;
    bottom: 30px;
    left: 0px;
    right: 0px;
    height: 5px;
    -webkit-appearance: none !important;
    background-color: #FFFFFF;
}
#seekslider::-webkit-slider-thumb {
    -webkit-appearance: none !important;
    background-color: #006CD0;
    height: 13px;
    width: 13px;
    cursor: pointer;
    position:relative;
    box-shadow: 0 0 0 red,
    -13px 0 0 red,
    -26px 0 0 red,
    -39px 0 0 red,
    -52px 0 0 red,
    -65px 0 0 red,
    -78px 0 0 red,
    -91px 0 0 red,
    -104px 0 0 red,
    -117px 0 0 red;
    z-index:2;
}
<input id="seekslider" type="range" min="0.0" max="100.0" value="0" step="0.1">

关于css - 输入范围有两种不同的背景颜色,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30039349/

上一篇:css - 混合移动和桌面与网格系统

下一篇:html - 文字与图片重叠

相关文章:

javascript - 如何同时更改子菜单和子菜单边框的css

javascript - 使用函数时Jquery意外标记

javascript - iOS 上的 Safari,在弹出虚拟键盘之前是否有任何事件?

css - Zurb Foundation Sticky 在滚动时更改元素的大小

java - 使用 Selenium 和 Eclipse (Java) 断言表格边框的 css 样式

javascript - 用于重复 div 的 jQuery 插件

javascript - 带有 jquery 的 z-index 不适用于旋转图像

html - 无法将按钮与 CSS flex 或网格对齐

html - 桌面屏幕尺寸的背景图片太小?

javascript - 是否可以使用 javascript 更改我的 css sprite 显示的子图像?