css 自定义 radio

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/beyondwu123/article/details/80279244
.m-addapi-checkstate label::before {
    content: "\a0"; /*不换行空格*/
    display: inline-block;
    vertical-align: middle;
    width: 1em;/*em相对当前font-size大小  */
    height: 1em;
    margin-right: .4em;
    border-radius: 50%;
    border: 1px solid #5BD1AD;
    text-indent: .15em;
    line-height: 1; 
    font-size: 14px;
font-weight: 100;
margin-bottom: 3px;
}
.m-addapi-checkstate input[type="radio"]:checked + label::before {
    background-color: #5BD1AD;
    background-clip: content-box;/*绘制背景区域  */
    padding: .09em;
}
.m-addapi-checkstate input[type="radio"]{
position: absolute;
    clip: rect(0, 0, 0, 0); 
}

猜你喜欢

转载自blog.csdn.net/beyondwu123/article/details/80279244