css - 如何将内容设置为-webkit-slider-thumb

标签 css safari webkit

我有一个范围类型的输入

<input id="counter" type="range" min="0" ></input>

使用以下 CSS

#counter {
    -webkit-appearance: none;
    background-color: silver;
    width: 200px;
    height:10px;
    border-radius:50px;
    border-color:rgb(240, 61, 37);
}

#counter::-webkit-slider-thumb {
    -webkit-appearance: none;
    width:15px;
    height:15px;
    border-radius:50px;
    content:"1";
    background:rgb(240, 61, 37);
    opacity:0.95;
}

现场演示 here

content:"1"; css 根本不起作用,如何在输出中将一些文本设置为红色旋钮。

最佳答案

::-webkit-slider-thumb 无法接受 content 属性。请尝试设置背景图片。

关于css - 如何将内容设置为-webkit-slider-thumb,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14502218/

相关文章:

jquery - 使用 jquery 动态地在 img 标签后追加 div

css - 属性 nth-child 似乎在 JSP CSS 中不起作用

WordPress 背后的反向代理 : Session-cookies not set in Safari & IE

android - 从 android webkit 浏览器获取当前 Url

css - 将 -webkit-tap-highlight-color 应用于空白会导致 phonegap 应用程序出现故障

CSS 渐变 - 更少的混合

css - 什么是 LESS 源映射?

html - 输入[类型="radio"]#amountSelectionOther :checked+label+input#amountSelectionOtherField{display: inline-block;} not working in Safari

html - iOS 上 Safari 的奇怪的边距底部行为

css - 壁虎与 Webkit : padding inside inline blocks