我想创建一个这样的复选框。带有白色刻度和透明背景。有人可以帮助我如何做我试过
input[type="checkbox"]{ background-color:rgba(255,255,255,0.1); color:white; }
但不像在这个代码笔中那样工作
您可以使用下面的 css 来获得相同的效果
input[type="checkbox"].hidden {
display: none;
}
.demoCheck {
border: 1px solid #ddd;
width: 25px;
height: 25px;
display: block;
}
input[type="checkbox"]:checked.hidden + label {
background: url(http://www.clipartsfree.net/vector/small/23493485345_Clipart_Free.png) center center no-repeat;
background-size:cover;
}
<input type="checkbox" class="hidden" id="demo" >
<label for="demo" class="demoCheck demoCheckLabel"></label>
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句