Home / Learn HTML / HTML Accessibility

HTML Accessibility

Accessible pages work for everyone: people who use screen readers, keyboards, voice or large text.

In shortUse real elements (button, label, headings), write alt text, keep good colour contrast and make everything work with the Tab key.

Definition

Accessibility (a11y) means that everyone can use your page, including people who are blind, deaf, colour blind, cannot use a mouse or use slow connections. It is also good for SEO, and in many countries it is the law.

Theory in plain words

From HTML to userSemantic HTMLAccessibility treeScreen readerUser understands
From HTML to user

What it is

Accessibility means making pages usable for everyone, including people who use screen readers, keyboards or zoom.

Why we use it

About one in six people live with a disability. Accessible pages also rank better and are required by law in many places.

How it works

Use semantic elements, alt text, labels and good contrast. Browsers build an accessibility tree that assistive technology reads.

Where it is used

  • Public and government sites
  • Shops and banks
  • Every website
Alt textTry it Yourself
Decorative imageTry it Yourself

Empty alt tells screen readers to skip it.

Labels for inputsTry it Yourself
Real button, not a divTry it Yourself

A real button works with keyboard and screen readers automatically.

aria-label for icon buttonsTry it Yourself
Skip linkTry it Yourself

Press Tab once to reveal the link. It helps keyboard users skip the menu.

LandmarksTry it Yourself
Heading orderTry it Yourself
Focus outlineTry it Yourself
Colour contrastTry it Yourself
Live region (announce changes)Try it Yourself
Table headersTry it Yourself
Describe a fieldTry it Yourself
Hidden but readable by screen readersTry it Yourself
Language for partsTry it Yourself
Details for expandable contentTry it Yourself

Quick quiz

1. Which makes a button work with keyboard automatically?

2. Decorative images get

3. Good contrast means

My notes
Ask a question about this lesson