HTML & CSS · Senior · Question 50 of 75
A designer insists on fully custom styles for every control in a complex form. What's a sensible approach?
- 1Replace all native controls with
<div>s and click handlers - ✓Correct answer: Style the native controls (
appearance: none,accent-color) - 3Refuse the designer: native form elements can't be styled
Explanation
Native controls give you accessibility, keyboard support, autofill and mobile pickers for free. Most of their appearance can be changed via appearance: none, accent-color, pseudo-elements and :checked / :focus-visible. Hand-made <div> widgets require full ARIA pattern implementations - expensive and risky. Discuss the trade-offs with the designer.