input[type="checkbox"] + label::before { content: "\a0"; /*不换行空格*/ display: inline-block; width: 13px; height: 13px; border-radius: .0em; /*改变方框形状*/ background-color: white; border: 1px solid black; vertical-align: middle; font-size: 18px; line-height: 1; margin-bottom: 3px; } /*勾选状态*/ input[type="checkbox"]:checked + label::before { content: '\2713'; /*2713、2714都是勾,一个粗一个细*/ font-size: 12px; text-align: center; } /*隐藏checkbox*/ input[type="checkbox"] { position: absolute; clip: rect(0, 0, 0, 0); }
<input type="checkbox" id="chek1"/> <label for="chek1"> 有</label>
<input type="checkbox" id="chek2"/> <label for="chek2"> 无</label>