Accessibility · Junior · Question 71 of 75
How do you style a custom checkbox accessibly?
- 1Use a
spanwith a click handler on it - 2Replace it with a
divand an icon image - 3Keep a real
inputand style around it
Show the answer
Correct answer: Keep a real input and style around it
Explanation
The native input keeps its focus, keyboard support and state. Visually hide it, or use appearance: none, and style the box. Check the focus style too.