修改html复选框样式

html:

 <input type="checkbox" value="checkbox" name="checkbox" id="checked">

css:

.con form .check input[type="checkbox"] {
    width: 0.3rem;
    height: 0.3rem;
    display: inline-block;
    text-align: center;
    vertical-align: middle;
    line-height: 0.3rem;
    position: relative;
}
 
.con form .check input[type="checkbox"]::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    background: #fff;
    width: 100%;
    height: 100%;
    border: 0.01rem solid #CACDCF
}
 
.con form .check input[type="checkbox"]:checked::before {
    content: "\2713";
    background-color: #eee;
    color: #575757;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    border: 1px solid #ddd;
    font-size: 0.2rem;
    font-weight: bold;
}

版权声明:本文为dreamimport原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。