Skip to content
M

Web Accessibility Basics Every Developer Should Apply

Semantic HTML, keyboard support, contrast, focus states and labels. Small habits that make your site usable by everyone and better for SEO.

Md. Nazim Uddin

Updated Oct 25, 20262 min read0 views

Share
Web Accessibility Basics Every Developer Should Apply
On this page

Accessibility helps people with disabilities, but it also helps everyone using a phone in sunlight, a keyboard only, or a slow connection. It improves SEO too.

Use semantic HTML

Use button for actions, a for navigation, nav, main, header, footer and real headings in order. Screen readers and search engines use this structure to understand the page.

Make everything keyboard friendly

Try your site using only the Tab, Enter, Space and Escape keys. Every control must be reachable, and a modal must trap focus and close with Escape.

Keep focus visible

Never remove the outline without replacing it. A clear focus ring tells keyboard users where they are.

Check color contrast

Normal text should have at least a 4.5:1 contrast ratio against its background. Light gray text on white looks stylish and fails many users.

Label your forms

Every input needs a visible label connected to it. Placeholders are not labels, since they disappear while typing. Show errors in text, not by color alone.

Write real alt text

Describe the purpose of meaningful images. Use an empty alt="" for purely decorative ones so screen readers skip them.

Use ARIA sparingly

The first rule of ARIA is to use native HTML when possible. Add ARIA only for custom widgets, and keep it accurate: a wrong role is worse than none.

Respect motion preferences

Honor prefers-reduced-motion and avoid auto-playing animation that cannot be paused.

Test regularly

Run Lighthouse and axe, then test with a keyboard and a screen reader. Automated tools catch only a part of the problems.

Takeaway

Semantic markup, keyboard access, contrast and clear labels cover most issues. Build them in from the start.

Keep reading

TypeScript Tips Every React Developer Should Know
Web Development
2 min read0

TypeScript Tips Every React Developer Should Know

Typing props, hooks, events and API data with TypeScript, plus utility types and patterns that remove whole classes of bugs.

ReactTypeScript
MNMd. Nazim UddinRead