I am trying to have a letter being a checkbox so that when the checkbox is clicked the background of the checkbox changes but the letter is still there. So far I got the checkbox to change color when checked, but unable to get letter as a background. Also each checkbox will have a different letter.
.checkbox {
display: inline-block;
cursor: pointer;
font-size: 13px;
line-height: 18px;
}
input[type=checkbox] {
display: none;
}
.checkbox:before {
content: "";
display: inline-block;
width: 40px;
height: 40px;
vertical-align: middle;
text-align: center;
border-width: 5px;
border-style: solid;
border-radius: 25px;
}
input[type=checkbox]:checked+.checkbox:before {
background-color: red;
background-size: contain;
}
<input type="checkbox" id="checkbox">
<label class="checkbox" for="checkbox"></label>
<label>S</label>