CSS怎样修改单选框和复选框的样式
2017-12-22 本文已影响0人
十里柔情
单选框
input[type=radio]{
height: 0.28rem;
width: 0.28rem;
vertical-align: middle;
margin-left: 0.1rem;
background-color: transparent;
-webkit-appearance: none;
border-radius: 50%;
position: relative;
}
input[type=radio]:checked:before{
content: "";
display: inline-block;
height: 0.32rem;
width: 0.32rem;
background: url(../images/checked.png) no-repeat;
background-size: 100% 100%;
border-radius: 50%;
position: absolute;
top: -0.04rem;
left: -0.04rem;
}
复选框
input[type=checkbox]{
height: 0.28rem;
width: 0.28rem;
border: 1px solid #c3c3c3;
background-color: transparent;
-webkit-appearance: none;
position: relative;
border-radius: 0.04rem;
}
input[type=checkbox]:checked:before{
content: "";
display: inline-block;
height: 0.3rem;
width: 0.3rem;
background: url(../images/checked2.png) no-repeat;
background-size: 100% 100%;
position: absolute;
top: -0.04rem;
left: -0.04rem;
}