TechnicalMedium HTML & CSS
What are the basics of web accessibility you follow?
Asked for Frontend Developer
Why they ask this: Accessibility is increasingly expected; it shows care for all users and code quality.
Answer
- Use semantic elements (
<button>,<nav>,<main>, headings in order) before reaching for ARIA. - Give images meaningful
alttext (alt=""for decorative images). - Connect every form field to a
<label>(for/id, or wrap the input). - Make everything usable with the keyboard: a logical tab order and a visible
:focus-visiblestyle. - Keep enough colour contrast: at least 4.5:1 for normal text (WCAG AA).
- Use ARIA only to fill gaps, for example
aria-expandedon a menu toggle oraria-livefor status messages.
Check your work with Lighthouse or axe DevTools and by navigating with only the keyboard.
Can you explain this in your own words?