šŸš€ LEVEL UP TO SENIOR:Unlock 500+ Advanced Practical Challenges & Exercises.
šŸŽ“ COURSERA PARTNER:Earn professional Google, Meta, and IBM certificates to supercharge your resume.
HTML MASTER CLASS /// LEARN TAGS /// BUILD STRUCTURE /// SEMANTIC WEB /// HTML MASTER CLASS /// LEARN TAGS ///

Web Accessibility: Building For Every User

Understand why accessibility is a core engineering requirement, meet the WCAG POUR principles, and learn how the accessibility tree connects your markup to assistive technology.

⚔ Total XP: 0|šŸ’» html XP: 0

Skill Matrix

UNLOCK NODES BY LEARNING NEW TAGS.

Accessibility Core

Foundational A11Y concepts.


šŸš€ LEVEL UP TO SENIOR:Unlock 500+ Advanced Practical Challenges & Exercises.
šŸŽ“ COURSERA PARTNER:Earn professional Google, Meta, and IBM certificates to supercharge your resume.

Accessibility is the discipline of ensuring digital products can be perceived, operated, and understood by people with a full range of abilities. It is not a checkbox exercise — it is a direct consequence of writing correct, semantic HTML.

1Why Accessibility Is An Engineering Concern

It is tempting to treat accessibility as a design nicety, something a QA pass adds at the end. In practice it is closer to type-safety or security: a property that has to be designed in from the first line of markup, because retrofitting it is exponentially more expensive.

The World Health Organization estimates that over a billion people, roughly 16% of the global population, experience some form of significant disability. That includes permanent conditions like blindness or motor impairment, but also temporary and situational ones — a broken arm, a bright sunlit screen, a noisy train platform where audio is unusable. Accessible markup benefits all of these cases simultaneously, because it is built on the same principle: don't assume a single way of consuming content.

Legally, many jurisdictions now mandate accessibility (ADA in the US, EN 301 549 in the EU) for public-facing and government-adjacent software, making this a compliance requirement as much as an ethical one.

<!-- Inaccessible: a clickable span -->
<span onclick="toggleMenu()">Menu</span>


<!-- Accessible: a real, focusable button -->
<button aria-expanded="false">Menu</button>
localhost:3000
āœ“ Keyboard & Screen-Reader ReadyThe

2The Four POUR Principles

The Web Content Accessibility Guidelines (WCAG) organize every success criterion under four umbrella principles, abbreviated POUR.

Perceivable — information must be presentable in ways every user can perceive: text alternatives for images, captions for video, sufficient color contrast. Operable — all functionality must be reachable via keyboard alone, with no time limits that can't be extended, and no content that flashes in a way that triggers seizures. Understandable — text must be readable, interfaces must behave predictably, and forms must help users avoid and correct mistakes. Robust — content must be interpretable by a wide range of user agents, including current and future assistive technologies, which is why valid, semantic HTML matters so much.

Every lesson in this module maps back to one or more of these four pillars.

<!-- Perceivable + Operable in one line -->
<img src="logo.svg" alt="Code Syllabus home">
localhost:3000
āœ“ POUR CompliantA text alternative makes the image perceivable to screen readers, and the surrounding link remains fully operable by keyboard.

3The Accessibility Tree

Every modern browser builds two parallel trees from your HTML: the DOM, used for rendering and scripting, and the accessibility tree, used to communicate with assistive technology through OS-level APIs (like UIA on Windows or AX on macOS).

Each node in the accessibility tree carries a role (button, heading, navigation), an accessible name (usually derived from text content, aria-label, or an associated <label>), and a state (checked, expanded, disabled). Native HTML elements populate all three automatically. Generic elements like <div> and <span> populate none of them unless you add ARIA attributes manually.

This is why the guiding rule of accessible development is: prefer a native element with built-in semantics over a generic element with ARIA bolted on. Native elements are tested across every browser and assistive technology combination that exists; hand-rolled ARIA is not.

<!-- Native: role, name, state for free -->
<input type="checkbox" checked>
localhost:3000
ā–¼ Accessibility Tree
checkbox "Subscribe" checked

4Step-by-Step Breakdown

Accessibility Is Not Optional. Roughly one in six people worldwide lives with some form of disability. Accessibility (shortened A11Y, for the 11 letters between 'A' and 'Y') is the practice of building interfaces that this entire population can perceive, operate, and understand — using the browser's native semantics as the foundation.

Accessibility Is An Engineering Requirement. Accessibility is not a visual theme you bolt on at the end. It is a structural property of your HTML, exactly like performance or security. A div-soup interface styled to look like a button is invisible to a screen reader, no matter how good it looks visually.

Structural Accessibility. A <div> styled with CSS to look exactly like a button is clicked with a mouse just fine. Why does it still fail an accessibility audit?

  • →It fails because the color contrast is wrong
  • →It fails because it carries no keyboard or screen-reader semantics
  • →It doesn't fail; visual matching is sufficient

The Four POUR Principles. Every accessibility guideline traces back to four principles known as POUR: Perceivable, Operable, Understandable, and Robust. Content must be perceivable through more than one sense, operable without a mouse, understandable in its language and behavior, and robust enough to work with assistive technology.

POUR Principles. Which one of these is NOT one of the four WCAG POUR principles?

  • →Performant
  • →Operable
  • →Robust

Assistive Technology Reads The DOM, Not The Screen. Screen readers, switch devices, and braille displays never see your pixels. They query the accessibility tree, a parallel structure the browser builds from your DOM. If an interactive control has no name, no role, or no state in that tree, it effectively does not exist for those users.

The Accessibility Tree. A screen reader user navigates your page. What structure is it actually querying to know what's on screen?

  • →The rendered pixel buffer, like a screenshot
  • →The accessibility tree derived from the DOM
  • →The compiled CSSOM stylesheet rules

Foundation Secured. You now understand accessibility as a structural engineering discipline governed by the POUR principles, and why assistive technology depends entirely on the accessibility tree generated from your HTML. Every lesson in this module builds directly on this foundation.

Add The Core Landmarks. Semantic landmarks like <nav> and <main> let assistive tech users jump straight to key regions.

Level Up šŸš€

Advanced cheat sheets, SEO tricks, and interview prep for this topic.

Browser Support

ChromeSupported

Fully supported.

FirefoxSupported

Fully supported.

SafariSupported

Fully supported.

EdgeSupported

Fully supported.

Accessibility (A11y)

1Native Elements Populate The Accessibility Tree Automatically

`<button>`, `<input>`, `<a href>`, and other native interactive elements ship with a correct role, an accessible name derivation strategy, and keyboard behavior — none of which has to be reimplemented with ARIA.

2The POUR Principles Are Testable, Not Just Aspirational

Each WCAG success criterion under Perceivable, Operable, Understandable, and Robust maps to a concrete, testable condition (e.g. 'contrast ratio ≄ 4.5:1'), which is what makes automated and manual accessibility audits possible.

SEO Implications

  • 1

    Accessible Markup Overlaps Heavily With Crawlable Markup

    Search engine crawlers, like screen readers, cannot see pixels — they parse the DOM. Descriptive `alt` text, real headings, and semantic landmarks improve both accessibility and how well crawlers understand page structure.

  • 2

    Accessibility Compliance Is Increasingly A Search & Legal Ranking Factor

    While not a direct ranking signal, sites facing accessibility lawsuits or low engagement from assistive-technology users often see indirect SEO harm through higher bounce rates and lower dwell time.

Best Practices

Default To Native HTML Elements Before Reaching For ARIA

A native `<button>` gets keyboard support, focus styling hooks, and correct semantics for free; recreating that with `<div role="button">` requires manually wiring tabindex, key handlers, and ARIA state — and is easy to get subtly wrong.

Test With A Real Screen Reader Early, Not Just A Linter

Automated accessibility linters catch roughly a third of real-world issues. Pairing them with a five-minute pass using VoiceOver, NVDA, or TalkBack surfaces problems no static analysis tool can detect.

Frequent Bugs

THE BUG

A custom dropdown works with a mouse but is completely unusable with a keyboard.

THE FIX

The dropdown was built from `<div>` elements with click handlers instead of native `<button>`/`<select>` elements or a fully ARIA-compliant combobox pattern with keyboard event handling.

THE BUG

A screen reader announces an icon-only button simply as 'button', with no indication of what it does.

THE FIX

The button has no accessible name. Add visually-hidden text, an `aria-label`, or `aria-labelledby` pointing at a descriptive label.

Real-World Examples

Accessible Icon Button

A production toolbar button that closes a modal, using only an icon visually but remaining fully announced to assistive technology.

<button type="button" aria-label="Close dialog">
  <svg aria-hidden="true" focusable="false">...</svg>
</button>

Interview Prep

?Frequently Asked Questions

Pascual Vila

Pascual Vila

Frontend Instructor // Code Syllabus

Common Pitfalls & Errors

The Error //

Using a `<div>` or `<span>` for interactive controls

<!-- Wrong --> <span onclick="submit()">Submit</span> <!-- Correct --> <button type="submit">Submit</button>

The Solution //

Use the native element that matches the behavior you need: `<button>` for actions, `<a href>` for navigation, `<input>`/`<select>` for form controls.

The Error //

Assuming visual testing is sufficient

<!-- Checklist --> <!-- 1. Tab through the page --> <!-- 2. Run a screen reader --> <!-- 3. Run axe-core -->

The Solution //

Pair automated linting (axe, Lighthouse) with a manual pass using a real screen reader (VoiceOver, NVDA) and keyboard-only navigation.

Lesson Glossary

[01]Accessibility (A11Y)

Designing interfaces usable by people of all abilities.

Code Preview
A11Y

[02]POUR

Perceivable, Operable, Understandable, Robust — the four WCAG principles.

Code Preview
POUR

[03]Accessibility Tree

Parallel structure to the DOM consumed by assistive technology.

Code Preview
AX Tree

[04]Assistive Technology

Software/hardware like screen readers used to access content.

Code Preview
AT

Continue Learning