I have customized my checkbox to appear as a circle, and now I want to display a check mark when the user selects the checkbox.
When I remove -webkit-appearance: none;
, the check mark appears but my CSS stops working.
Is there a way to achieve this without compromising my CSS?
.checkbox_round {
width: 18px;
height: 18px;
background-color: white;
border-radius: 50%;
vertical-align: middle;
border: 1px solid #ddd;
outline: none;
cursor: pointer;
-webkit-appearance: none;
}
.checkbox_round:hover {
border-color: #000;
}
.checkbox_round:checked {
background-color: #f00;
}
<label><input type="checkbox" name="name1" value="1" class="checkbox_round"> check box1 </label>
<label><input type="checkbox" name="name2" value="2" class="checkbox_round"> check box1 </label>
<label><input type="checkbox" name="name3" value="3" class="checkbox_round"> check box1 </label>