
Hello, I'm styling checkboxes for a character sheet, instead of a classic checkbox, I want a big red one. I used the old pure html+css solution for this case because I need other unstyled checkboxes on the sheet to pair with them (same attr_name). Here's my code: html: <td class='sheet-carton'>
<input type='checkbox' class="sheet-carton-jaune" name='attr_puissance1' value='-10[Carton jaune]' /><span></span>
<input type='checkbox' class="sheet-carton-rouge" name='attr_puissance2' value='-10[Carton rouge]' /><span></span>
</td> css: /* Fake checkbox carton jaune */ input[type="checkbox"].sheet-carton-jaune { opacity: 0; width: 16px; height: 16px; cursor: pointer; z-index: 1; } input[type="checkbox"].sheet-carton-jaune + span::before { margin-left: -16px; margin-right: 4px; line-height: 12px; text-align: center; display: inline-block; vertical-align: middle; content: " "; color: #f4df42; background-color: rgba(255, 255, 255, 0.4); border: solid 4px #f4df42; width: 10px; height: 10px; font-size: 12px; } input[type="checkbox"]:checked.sheet-carton-jaune + span::before { content: "✔"; position: relative; top: -1px; } /* Fake checkbox carton rouge */ input[type="checkbox"].sheet-carton-rouge { opacity: 0; width: 16px; height: 16px; cursor: pointer; z-index: 1; } input[type="checkbox"].sheet-carton-rouge + span::before { margin-left: -16px; margin-right: 4px; line-height: 14px; text-align: center; display: inline-block; vertical-align: middle; content: " "; color: #b74437; background-color: rgba(255, 255, 255, 0.4); border: solid 4px #b74437; width: 10px; height: 10px; font-size: 12px; } input[type="checkbox"]:checked.sheet-carton-rouge + span::before { content: "✔"; position: relative; top: -1px; } They'll both be on the same line. The problem I encounter is that when the boxes are unchecked, all's right, I can check them, but when they're checked, I can't access the invisible checkbox anymore... Does anyone have an idea of what might be causing this problem? Thank you.