I recently customized my checkboxes using CSS, and while they are working fine in Chrome, I encountered issues with Internet Explorer and Edge. In my search for a solution, I came across this helpful reference: ref
Here is the CSS code snippet that I used:
.checkbox-style {
display: none;
}
.checkbox-style + label {
position: relative;
display: block;
width: 14px;
height: 14px;
border: 1px solid #C0C5C9;
content: "";
background: #FFF;
align-items: center;
}
.checkbox-style[type="checkbox"]:checked + label:before {
font-family: 'FontAwesome' !important;
content: "\f00c";
border: none;
color: #015CDA;
font-size: 12px;
-webkit-text-stroke: medium #FFF;
margin-left: -11px;
}
Below is the corresponding HTML markup:
<span class="checkbox-wrapper" role="presentation"> <input type="checkbox" class="checkbox-style"><label></label></span>
Despite achieving the desired appearance for the checkbox, I am facing an issue where the :before pseudo-element of the label does not get created upon clicking the checkbox. As a result, the checkboxes remain uncheckable. What could be causing this problem?