自定义(滑动条)
可以去除浏览器默认样式,但却是一个不规范的属性(unsupported WebKit property),
它没有出现在 CSS 规范草案中,此属性非标准且渲染效果在不同浏览器下不同,有些属性值甚至不支持,请慎用。
input[type="range"] {
-webkit-appearance: none;
width: 100%;
margin: 0;
background: transparent;
}
input[type="range"]:focus {
outline: none;
}
/*滑道*/
input[type="range"]::-webkit-slider-runnable-track {
background: transparent;
border: none;
}
/*滑块*/
input[type="range"]::-webkit-slider-thumb {
-webkit-appearance: none;
width: 12px;
height: 12px;
border-radius: 50%;
margin-bottom: 15px;
background-color: transparent;
box-shadow: 0 0 0 3px white, 0 1px 3px 3px rgba(5, 10, 70, 0.33);
}
自定义(滚动条)
/*滑道*/
::-webkit-scrollbar-track
{
border-radius: 10px;
background-color: #fff;
-webkit-box-shadow: inset 0 0 6px rgba(0, 0, 0, .3);
}
/*滑动条*/
::-webkit-scrollbar
{
width: 7px;
background-color: #fff00;
}
/*滑块*/
::-webkit-scrollbar-thumb
{
border-radius: 10px;
background-color: #b3b3b3;
-webkit-box-shadow: inset 0 0 6px rgba(0, 0, 0, .3);
/*background:linear-gradient(to bottom,red,#ffe607,#fffa04,#0fff4e,#00a1ff,#ef00ff); */
}
自定义(单选框)
input[type="radio"] {
appearance: none;
-webkit-appearance: none;
outline: none;
margin: 0;
}
input[type="radio"]:after {
display: block;
content: "";
width: 12px;
height: 12px;
background: #fff;
border-radius: 50%;
border: 2px solid #bfbfbf;
}
/*已选择*/
input[type="radio"]:checked:after {
background: #0593d3;
border: 2px solid #fff;
}