Accessibility sounds like a big specialist topic, and parts of it are. But most of what makes a site usable for people with disabilities comes down to writing proper HTML and keeping a few habits. If you get the basics right from the start, you avoid most problems without extra effort.
Think about who uses your site. Someone who is blind and uses a screen reader. Someone who cannot use a mouse and moves around with the keyboard. Someone with low vision who zooms the page right in. Someone with a broken arm, using one hand. Someone on a cheap phone in bright sunlight. Good accessibility helps all of them.
Use the right HTML element
This is the single most important habit. HTML elements come with built-in behaviour that assistive technology understands.
<!-- Bad: looks like a button, but is not one -->
<div class="btn" onclick="save()">Save</div>
<!-- Good -->
<button type="button" onclick="save()">Save</button> The div version cannot be reached with the Tab key, does not respond to Enter or Space, and a screen reader does not announce it as a button. The real button does all of that for free.
The same goes for links. If it takes you to another page, use <a href>. If it does something on the current page, use <button>.
Structure the page with landmarks
Use header, nav, main, footer, aside and section. Screen reader users can jump straight to these regions instead of listening to the whole page from the top.
<header>...</header>
<nav aria-label="Main">...</nav>
<main>
<h1>Page title</h1>
...
</main>
<footer>...</footer> Headings in order
Use one h1 for the page title, then h2 for sections, h3 inside those, and so on. Do not pick heading levels based on font size. Many screen reader users move around a page by its headings, a bit like reading a table of contents. If you need a big font, style it with CSS.
Alt text for images
Every img needs an alt attribute. What goes in it depends on the image:
- Informative images: describe what matters. alt=”Student working on a laptop in a classroom”.
- Images that are links or buttons: describe the action. A logo linking home could be alt=”Home”.
- Decorative images: use an empty alt, alt=””. The screen reader skips it. Leaving alt out entirely is worse, because some screen readers read out the file name instead.
Do not start with “image of”. The screen reader already says it is an image.
Every form field needs a label
<label for="phone">Mobile number</label>
<input id="phone" name="phone" type="tel" autocomplete="tel"> The for attribute connects the label to the input. Clicking the label now focuses the field, which also gives everyone a bigger click target. Placeholders are not labels: they vanish when you type and are often low contrast.
Error messages should be text near the field, not just a red border. Colour alone does not tell a colour-blind user anything.
Make everything work with a keyboard
Put your mouse away and try your site with just the Tab, Shift+Tab, Enter, Space and arrow keys. Can you reach every link, button and form field? Can you open and close the menu? Can you get out of a popup?
If you used real buttons and links, most of this will already work. Problems usually come from custom dropdowns, sliders and modals built from divs.
Do not hide the focus outline
That blue or black ring around a focused element is how keyboard users know where they are. Never do outline: none without replacing it with something just as clear.
a:focus-visible,
button:focus-visible {
outline: 3px solid #1a56db;
outline-offset: 2px;
} focus-visible shows the ring for keyboard users but usually not on mouse clicks, which keeps designers happy too.
Add a skip link
A link at the very top that jumps to the main content saves keyboard users from tabbing through the whole menu on every page.
<a class="skip-link" href="#main">Skip to content</a>
...
<main id="main"></main> You can hide it visually until it receives focus.
Colour contrast
Light grey text on white might look elegant on your big monitor, but it is hard to read for many people, and for everyone on a phone outdoors. WCAG, the main accessibility guideline, asks for a contrast ratio of at least 4.5:1 for normal text and 3:1 for large text. Browser developer tools show the contrast ratio when you inspect text, so checking takes seconds.
Set the page language
<html lang="en"> This tells screen readers which pronunciation to use. If a section is in another language, for example a Hindi paragraph, mark it with lang=”hi” on that element.
ARIA: use it sparingly
ARIA attributes add extra information for assistive technology, like aria-label, aria-expanded or aria-live. They are useful, but the first rule of ARIA is: if a native HTML element does the job, use that instead. Bad ARIA is worse than no ARIA, because it tells screen readers something that is not true. Start with good HTML and only reach for ARIA to fill real gaps, like telling users that a menu is open:
<button aria-expanded="false" aria-controls="menu">Menu</button> Then update aria-expanded with JavaScript when the menu opens and closes.
Respect motion and zoom
- Never disable zoom in the viewport meta tag. Some people need it.
- Use relative units like rem for font sizes so text scales with browser settings.
- Tone down big animations for users who ask for it with the prefers-reduced-motion media query.
How to test without special tools
- Go through the whole page using only the keyboard.
- Zoom the browser to 200 percent and check nothing breaks or overlaps.
- Run Lighthouse or the axe browser extension for an automated scan.
- Try a screen reader for ten minutes. NVDA is free on Windows, and VoiceOver comes built into Mac, iPhone and iPad. TalkBack is on Android.
Automated tools only catch part of the problem, so the manual checks matter. Make these a normal part of finishing any page and accessibility stops being a separate task. It just becomes how you build.