Chapter 15 of 17 · HTML for Beginners — Complete Free Tutorial
HTML Accessibility
Web accessibility means anyone can use your site — including people who navigate by keyboard, use screen readers, have low vision, or process information differently. Most accessibility is achieved with plain HTML choices, not code. Google also considers usability signals (mobile-friendliness, structure) in ranking, so accessible HTML is doubly valuable.
The four principles (POUR)
| Principle | Plain-English meaning |
|---|---|
| Perceivable | Users can perceive the content — alt text, captions, sufficient contrast |
| Operable | Users can operate the interface — full keyboard support, no traps |
| Understandable | Content and behaviour are predictable — clear labels, consistent navigation |
| Robust | Works across browsers and assistive technologies — valid, semantic HTML |
1. Write meaningful text alternatives
<!-- ✅ Describes the image's purpose -->
<img src="chart.png" alt="Sales grew 40% between Q1 and Q4 2026">
<!-- ✅ Purely decorative: empty alt makes screen readers skip it -->
<img src="divider-flourish.svg" alt="">
<!-- ✅ Icon-only button needs an accessible name -->
<button type="button" aria-label="Close dialog">×</button>
2. Associate every input with a label
Recap from Forms: <label for="id"> must match the control's id. Placeholder text is not a label. Buttons need visible text or aria-label.
3. Keyboard operability
- Every interactive element must be reachable with Tab and activatable with Enter/Space.
- Native elements (
<button>,<a>,<input>) are keyboard-accessible for free. A<div onclick>is not — this is the single biggest argument for semantic HTML. - Provide a skip link as the first focusable element (see Semantic Layout).
- Never remove the focus outline without replacing it:
:focus-visible { outline: 2px solid #4f46e5; }.
4. Structure with landmarks and headings
<header>...</header>
<main>
<h1>Order summary</h1>
<h2>Items (3)</h2>
...
</main>
<footer>...</footer>
Screen reader users jump between landmarks and skim headings instead of reading linearly. One h1, sequential levels, descriptive text — this is the same checklist SEO wants.
5. ARIA: the last resort, not the first
The first rule of ARIA: don't use ARIA when a native element does the job.
<!-- ❌ A div pretending to be a button: no focus, no Enter key, no role -->
<div class="btn" onclick="submitForm()">Send</div>
<!-- ✅ Native button: keyboard + screen reader support out of the box -->
<button type="button" onclick="submitForm()">Send</button>
<!-- ✅ ARIA used correctly: communicating state a native element can't -->
<button aria-expanded="false" aria-controls="menu-1">Menu</button>
<ul id="menu-1" hidden>...</ul>
When you do need ARIA, remember its three properties: role (what it is), aria-label/aria-labelledby (what it's called), aria-expanded/aria-pressed/aria-current (what state it's in).
6. Colour is never the only signal
<!-- ❌ "Red text = error" is invisible to many users -->
<p class="error">Invalid card number</p>
<!-- ✅ Icon + text + colour together -->
<p class="error" role="alert">⚠ Invalid card number — check the 16 digits.</p>
Also verify a contrast ratio of at least 4.5:1 for body text (3:1 for large text) — use a contrast checker when choosing colours.
7. Media accessibility
- Captions (
<track>) for video audio — see Multimedia. - Do not autoplay with sound.
- Give iframes a
title.
Real-life use case
A government tender form built with semantic HTML: every field labelled, errors announced via role="alert", a skip link past the header, logical Tab order, and radio groups inside <fieldset>. Result: it passes accessibility audits and works for all 100% of its users — including employees using assistive tech.
Common mistakes
- Accessibility as a "phase 2" task — retrofitting is 10× harder than building in.
- Click-to-open
divs — replace with<button>+aria-expanded. - Empty links (icon-only
<a>with no text) — addaria-label. - Reading order ≠ visual order — CSS can reorder visuals while Tab order stays broken; test with keyboard only.
- Ignoring zoom — never set fixed small font sizes; support 200% browser zoom (WCAG requirement).
Best practices & testing checklist
- Unplug your mouse and Tab through the entire page.
- Turn on VoiceOver (Mac: Cmd+F5) or Narrator (Windows) and navigate by headings.
- Run Lighthouse's accessibility audit in Chrome DevTools (also flags contrast issues).
- Validate HTML — invalid markup is assistive-tech guesswork.
- Test at 200% zoom and with images disabled.
What's next?
Package all of this for search engines in HTML & SEO, then finish with Validation, Debugging & Next Steps.
Frequently Asked Questions
HTML (HyperText Markup Language) is the standard markup language that defines the structure and meaning of every web page. Learning HTML is the fastest way into web development: it is the foundation that CSS, JavaScript, and every framework build upon, and it directly affects SEO and accessibility.
Most beginners can build their first complete page in a day and become comfortable with the core tags within 1–2 weeks of daily practice. This 17-chapter series is designed to be completed in about 2–3 weeks at a relaxed pace, faster if you type out every example.
Only a plain text editor (VS Code is free and popular) and a web browser. No installation, no setup, no account — create a file called index.html, double-click it, and it opens in your browser.
HTML5 is the current generation of the HTML standard (published as the living standard by WHATWG). When people say "HTML5" they usually mean modern HTML: semantic elements like header, nav and article, native audio/video, canvas, and improved form input types — all covered in this tutorial.
No. HTML is a markup language — it describes content and structure but has no variables, loops, or conditionals. Those come with programming languages like JavaScript, which you would learn after HTML and CSS.
Right here: every chapter includes examples you can retype in your own index.html file, plus practice challenges. After this series, build small projects — a portfolio page, a recipe page, or a landing page for a local business — they exercise the same tags in real contexts.
Search engines crawl HTML first. Unique titles, a single clear h1, a logical heading hierarchy, descriptive alt text, valid markup, fast-loading responsive images, and a proper internal linking structure all come straight from HTML — see the HTML & SEO chapter for the full checklist.
Accessible HTML makes your site usable by everyone, including people who rely on screen readers or keyboards, and it is a legal requirement in many countries. The good news: proper labels, semantic elements, alt text, and keyboard-operable controls are mostly free HTML habits.
No — there are roughly 100 meaningful tags and you will naturally use about 30 of them regularly. Focus on understanding purpose and structure; editors and references (like MDN) handle the rest. This tutorial covers every tag beginners actually need.
CSS for visual design and layout, then JavaScript for interactivity, then a version control system (Git). With those three you can build complete websites; frameworks like React or Laravel Blade come after the fundamentals feel natural.