Lesson 34 of 51 · Module 5, lesson 7 of 7 · 5 min
Accessibility basics: test without a mouse
Check your page with the keyboard, the headings, the landmarks and a screen reader, in five quick steps.
What you'll learn
- Five quick checks that find most accessibility problems in a page
- How to test your page with only the keyboard
- How to check your headings, landmarks and alt text with the developer tools
Why this matters
Accessibility means that people with disabilities can use your website: people who are blind, who cannot use a mouse, who see colours differently, or who need larger text. That is a very large group of people — and many of the same fixes also help people on phones, on slow connections, or in bright sunlight. In many countries, accessibility is also a legal requirement for public and business websites.
The good news: correct HTML — the HTML in this course — does most of the work. This lesson gives you a short routine to check it.
Check 1: Only the keyboard
Many people cannot use a mouse. They move through a page with the Tab key.
Open your page, click the address bar, then press Tab again and again:
- Can you reach every link, field and button?
- Can you always see where you are (a visible outline)?
- Is the order sensible — top to bottom, left to right?
- Does
Enterfollow a link, andSpacetick a checkbox?
(On macOS Safari, Tab skips links by default. Use Option + Tab, or turn on Press Tab to highlight each item on a webpage in Safari › Settings › Advanced.)
Check 2: The headings
Headings are the table of contents for screen reader users. Open the developer tools and look at every <h1>–<h6> in the Elements panel, or use a free "headings map" browser extension. Ask:
- Is there exactly one
<h1>, saying what the page is about? - Do the levels go down one step at a time?
- Does each heading say what its section contains?
Check 3: The landmarks
Is the page divided into <header>, <nav>, <main> and <footer>? Is there exactly one <main>? In Chrome or Edge, select an element in the developer tools and look at the Accessibility pane to see its role.
Check 4: Every image
- Does every
<img>have analt? - Does it describe the image, in words that make sense read aloud?
- Is it
alt=""for decoration?
A quick way: turn images off, or zoom out and read only the alt texts in the Elements panel. Would the page still make sense?
Check 5: Links, language and words
- Does every link make sense on its own? ("Read the soup recipe", not "click here".)
- Does
<html>have the rightlang? - Is important information given in words — not only in colour, bold, an emoji or a picture?
Listen to your page
Every computer and phone has a free screen reader. Try one for five minutes on your own page:
- Windows: Narrator — press
Windows key + Ctrl + Enterto turn it on or off. - macOS: VoiceOver — press
Command + F5to turn it on or off. - Android: TalkBack; iPhone: VoiceOver — both in the phone's Accessibility settings.
Listen to how your headings, links and images are read. It changes how you write HTML.
A complete example to test
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Tomato soup — Home Kitchen</title>
</head>
<body>
<header>
<nav>
<ul>
<li><a href="index.html">Home</a></li>
<li><a href="recipes.html">Recipes</a></li>
</ul>
</nav>
</header>
<main>
<h1>Tomato soup</h1>
<img src="images/tomato-soup.jpg" alt="A white bowl of hot tomato soup" width="300" height="200">
<p>Read the <a href="#steps">cooking steps</a> below.</p>
<h2 id="steps">Steps</h2>
<ol>
<li>Cut the tomatoes.</li>
<li>Cook them for twenty minutes.</li>
</ol>
</main>
<footer>
<p>Home Kitchen</p>
</footer>
</body>
</html>
Try it yourself
- Select the example and choose Try it. Click inside the preview, then press
Tabrepeatedly. Watch which items get an outline. - Run all five checks on your own
about.htmlandrecipe.html. Write down one problem you find and fix it.
Common mistakes
- Testing only with a mouse. Keyboard problems stay hidden. Fix: do Check 1 on every page.
- Removing the focus outline because it "looks ugly". Keyboard users get lost. Fix: never remove it; you can restyle it with CSS later.
- Thinking accessibility is extra work for later. Fixing it later is harder. Fix: write correct HTML from the start — you already are.
Check yourself
- Which key moves forward through the links and fields of a page?
- Name three of the five checks.
- How do you start the screen reader on your own computer?
Answers
Tab.- Any three of: keyboard only; headings; landmarks; images and alt text; links, language and words.
- Windows: Narrator,
Windows key + Ctrl + Enter. macOS: VoiceOver,Command + F5.
Next: put the structure elements together in the practice exercise, and test the result with the five checks.
a semantic recipe page
Starter code
Build it in your own folder, on your computer. ZAM students hand this project in on their dashboard, and their mentor reviews it.


