伪元素改变range类型input框的默认样式实例页面

回到相关文章 »

代码:

CSS代码:
::-webkit-slider-runnable-track {
    border: 1px solid #a0b3d6;
    background: #f0f3f9;
}
::-webkit-slider-thumb {
    outline: 1px dotted #a0b3d6;
    background-color: #34538b;
}
::-webkit-slider-runnable-track:hover {
    background-color: #cad5eb;
}


::-moz-range-track {
    border: 1px solid #a0b3d6;
    height: 20px;
    background: #f0f3f9;
}
::-moz-range-thumb {
    background: #34538b;
    height: 30px;
}

::-ms-fill-lower { background: orange; }
::-ms-fill-upper { background: green; }
::-ms-thumb { background: red; }
::-ms-ticks-before { display: block; color: black; }
::-ms-ticks-after { display: block; color: blue; }
::-ms-track { padding: 5px; }
::-ms-tooltip { display: none; /* 数值提示 只能是display或visibility */ }
                
HTML代码:
<input type="range" />
                

效果: