Library · Summary & review

Web Accessibility Cookbook

By Manuel Matuzović. 70+ recipes that teach accessibility by teaching HTML properly: the most practical a11y book out there.

FR EN
Web Accessibility Cookbook book cover, Manuel Matuzović

Web Accessibility Cookbook

Web Accessibility Cookbook: Creating Inclusive Experiences

8.8 /10

« The accessibility book disguised as the best HTML tutorial you'll read. »

  • AuthorManuel Matuzović
  • Year2024 · O'Reilly · 1st ed.
  • Pages382
  • This page~10 min read
Book rating across 5 dimensionsIdeas7/10Practical10/10Readability9/10Aged well9/10Examples9/10

Ready-to-use accessible components: the most recent and practical a11y book.

Why this book

Most accessibility books open by trying to convince you that accessibility matters. This one doesn't. In the foreword, Jeremy Keith says it outright: "This is not that book." Matuzović assumes you already agree, and hands you a guidebook instead, 70-plus recipes for the problems you actually hit.

I teach an accessibility course on this site, so I read it with a critical eye. It held up. Better still: Keith calls it "one of the best HTML tutorials you'll ever find," and he's right. You come for the accessibility recipes and you leave understanding markup itself, because good accessibility turns out to be good HTML.

The ideas that stay

1Every element has a name, a role, a state

The book is a true cookbook (thirteen chapters of standalone recipes), but under the recipes sits one mental model, and that is the one to take away. A blind person does not see your button; their screen reader announces it, as three pieces of information: a name (the text read out), a role (what kind of thing it is) and a state (checked, open, disabled…).

<button aria-pressed="true">Favorite</button>
<!-- announced: "Favorite, button, pressed" -->
<!--            ^name     ^role   ^state -->

All of accessibility fits in that loop: for each component, ask "are its name, role and state correct and announced?". A clickable <div> has no role and no state: to a screen reader, it does not exist. That is why the first rule (idea 2) is to use the right HTML element, which provides those three for free. And as the preface says, accessibility "doesn't just touch on the disciplines of web development, it connects them": the recipe for one is usually the recipe for all.

2The first rule of ARIA: don't use ARIA

The spine of the whole book: reach for the native HTML element first, and only add ARIA when no element does the job. A real <button> already ships with a role, keyboard support and focus; a <div role="button"> makes you rebuild all of that by hand, and the WebAIM Million found 27.5% of sites get it wrong.

Every interactive element needs two things the book keeps coming back to: a role (what kind of thing it is) and an accessible name (the text a screen reader announces). Get those right with plain HTML and most of accessibility is already done.

4Respect the user's settings, don't override them

Browsers and operating systems already expose what people need:

  • dark mode (prefers-color-scheme);
  • reduced motion (prefers-reduced-motion);
  • increased contrast and forced colors;
  • a bigger base font.

The chapter on CSS is one long argument that ignoring those signals is disrespect, not neutrality.

The detail that sticks: the media query is prefers-reduced-motion, "not prefers-no-motion for a reason" (ch. 5). The point is to cut gratuitous movement, not to kill every animation. And CSS can quietly break meaning: list-style: none can strip a list's semantics in Safari, so you sometimes have to add role="list" back.

5Focus is the cursor for people without a mouse

For keyboard and screen-reader users, the focus ring is the pointer. Matuzović's line is blunt: "Removing focus indicators for keyboard users is like hiding the cursor for mouse users" (ch. 6). So you never delete the outline; you style it, ideally with :focus-visible, and you keep it visible in Forced Colors mode with a transparent outline trick.

Two more rules close the chapter. Reading order follows the DOM, so reordering with CSS order or flex-direction desynchronizes what's seen from what's read. And for modals, prefer the native <dialog> or the inert attribute over a hand-rolled focus trap.

6There are five ways to hide content, and they're opposites

"Hidden" is not one thing. Hiding visually is not hiding from a screen reader, and the two are often confused with painful results. The book lays out the trade-offs side by side.

For the common case (a show/hide section), the native <details> works without a line of JavaScript; the chapter weighs it honestly against a custom disclosure widget when you need consistent cross-browser behavior.

7Half the web's form fields have no label

The number that frames the chapter: per the WebAIM Million 2023, "45.9% of tested websites contained form elements with missing labels" (ch. 9), meaning no <label>, the HTML element that names a field. A visible label, tied to its field with for/id, is the one non-negotiable; everything else (hints, error messages, grouping) only reduces the effort on top of it.

The recipes are the ones you reuse forever:

  • <fieldset> + <legend> for radio and checkbox groups;
  • aria-describedby for hints and error messages;
  • an error summary at the top that moves focus to itself on submit.

The placeholder-as-label, the book reminds you, is an anti-pattern: it vanishes the moment you type.

8Automated tests are a net, not a certificate

The closing chapter is a reality check. Tools like axe, Lighthouse and WAVE catch the mechanical errors, but not meaning. The difference is sharp:

<img src="chart.png">              <!-- axe CATCHES IT: missing alt, error -->
<img src="chart.png" alt="image">  <!-- axe SEES NOTHING: alt present…
                                          but "image" says nothing useful -->

"A perfect score doesn't mean your site is accessible" (ch. 13): the tool checks an alt exists, never that it actually describes the image. They're a starting net, not a finish line.

The most modern warning is about web components: the Shadow DOM's encapsulation breaks ID references, so a label in the light DOM can't point to an input in the shadow DOM. Worse, several popular auditors see nothing inside a shadow root at all. Build accessible components, then test them with a real screen reader.

A friendly robot proudly holds a checklist of green checkmarks with a 100 badge, while a person at a laptop frowns and points at a staircase with no ramp shown on the screen, the barrier the robot missed
A green score is a net that caught the easy ones, not proof the page is usable.

Three things I didn't know

My take, honestly

This is the accessibility book I'd hand to a working front-end developer today. It never moralizes, it never pads, and it earns Keith's compliment: teaching accessibility this concretely forces it to teach HTML properly, which is exactly what most of us are missing. The recipes are copy-paste useful and, rarer, honest about their trade-offs: more than once the answer is "there's no perfect way, here are the options, test with users."

The reservations are mostly about format. As a cookbook it's a reference you dip into, not a story you remember; read cover to cover, the recurring "use native HTML first" can feel repetitive (it's repeated because it's true). And the most valuable parts (the dated screen-reader support tables) are also the most perishable: in two years some rows will be wrong. Take the principles as permanent and re-check the tables.

In 2026 it has an unplanned second job: reviewing AI-generated markup. Models happily emit <div> soup with bolted-on ARIA, the exact failure mode this book trains you to spot and reject. Read it alongside Clean Code's care for the line and Ousterhout for the structure; this one owns the layer in between, the HTML the user actually touches.

Odilon

Still relevant in 2026?

Very. It's a 2024 book that already leans on modern CSS (:has(), :focus-visible, inert, animating grid-template-rows), so the techniques are current, not legacy. The one part to read with a date in mind is the screen-reader support tables (early 2024) and the still-moving web-components ARIA story. The principles, semantic HTML and the first rule of ARIA, don't expire.

Who is it for?

Read it if

  • You write HTML/CSS/JS and want accessible components without a six-month course first
  • You reach for role and aria-* before checking whether a native element exists
  • You review AI-generated markup and want a grid to judge it
  • You want one shelf reference for links, buttons, forms, focus, tables and components

Skip it if

  • You want the "why accessibility matters" case: this book deliberately skips it
  • You don't write front-end code: it's hands-on HTML/CSS/JS, not strategy
  • You expect a linear course: it's a recipe book, best read by dipping in

Going further

The accessibility course on this site practices exactly these foundations (semantic HTML, focus, forms), and the HTML course lays the groundwork the book assumes. The code for every recipe lives at accessibility-cookbook.com. In this library, Clean Code and A Philosophy of Software Design are its natural companions on writing code humans can actually use.

Comments (0)

Browse the whole library

More book notes coming: one book at a time, the marrow only.