← Back to Course

Module -10

Accessibility Fundamentals

Design for everyone. WCAG guidelines, semantic HTML, keyboard navigation, and screen readers — the essentials every designer must know.

Screen readers (VoiceOver, NVDA, JAWS), browser accessibility inspectors, axe DevTools, Lighthouse audits. Testing tools have become sophisticated and widely available.

Accessibility lawsuits are increasing. Companies are hiring dedicated a11y teams. "Shift left" — catch issues in design, not after launch. Inclusive design is becoming standard practice.

Perceivable, Operable, Understandable, Robust (POUR). These four principles from WCAG guide all accessibility work. Design for the extremes — it benefits everyone.

Part A

Core Concepts

01

Why Accessibility Matters

15-20% of people have disabilities. But accessible design benefits everyone — it's not just about compliance, it's about inclusion and better UX.

15%
Visual impairments
5%
Hearing impairments
7%
Cognitive disabilities
2%
Motor impairments
~1 billion people worldwide have some form of disability
Who Are We Designing For?

Disability isn't rare — it affects 15-20% of the global population. Visual impairments range from color blindness to total blindness. Motor impairments affect mouse use. Cognitive disabilities affect reading and comprehension.

Permanent
🦯
Blind user
Temporary
🤕
Eye surgery recovery
Situational
☀️
Bright sunlight glare
One arm → broken arm → holding a baby
Each benefits from one-handed operation
Disability Is a Spectrum

Disabilities aren't just permanent. A broken arm is temporary. Holding a baby is situational. Designing for accessibility helps everyone: captions help in noisy environments, large touch targets help when hands are full.

ADA
Americans with Disabilities Act
US law requiring accessible public accommodations — includes websites
WCAG
Web Content Accessibility Guidelines
International standard — Level AA is the common target
EAA
European Accessibility Act
EU directive — stricter enforcement starting 2025
Legal Requirements

Accessibility isn't optional in many jurisdictions. ADA lawsuits against inaccessible websites are common. WCAG 2.1 Level AA is the de facto standard for compliance. Ignoring accessibility is a legal risk.

Perceivable
Users can perceive content — alt text, captions, sufficient contrast
Operable
Users can interact — keyboard navigation, no time limits, no seizure triggers
Understandable
Users can comprehend — clear language, predictable behavior, error help
Robust
Works with assistive tech — valid HTML, ARIA support, future-compatible
The Four Principles (POUR)

WCAG is organized around four principles: Perceivable (can they sense it?), Operable (can they use it?), Understandable (can they comprehend it?), Robust (does it work with assistive tech?).

02

Semantic HTML

The foundation of accessibility. Using the right HTML elements gives structure, meaning, and free accessibility features.

Non-semantic (Bad)
<div class="button" onclick="...">
  Click me
</div>

<div class="heading">
  Page Title
</div>
Screen reader sees: "div, div" — meaningless
Semantic (Good)
<button>
  Click me
</button>

<h1>
  Page Title
</h1>
Screen reader sees: "button, heading level 1"
HTML Elements Have Meaning

Screen readers announce element types. A <button> is announced as "button" — users know they can click it. A <div> is announced as nothing. Semantic HTML provides meaning for free.

Wrong: Skipped levels
h1: Title
h4: Subsection (?)
h2: Section
Correct: Logical order
h1: Title
h2: Section
h3: Subsection
Screen reader users navigate by headings. Logical hierarchy = logical navigation.
Heading Hierarchy

Headings create document outline. Go in order: h1 → h2 → h3. Don't skip levels. Don't use headings just for styling — use CSS for visual size. Screen reader users jump between headings to navigate.

<header> / role="banner"
<nav>
<main>
<footer> / role="contentinfo"
Screen reader users can jump directly to any landmark
Landmark Regions

Landmark elements (<header>, <nav>, <main>, <footer>, <aside>) create navigable regions. Screen reader users can list all landmarks and jump directly to any section.

Lists announce item count
<ul>
  <li>Item 1</li>
  <li>Item 2</li>
</ul>
"List, 2 items"
Tables need headers
<table>
  <th>Name</th>
  <td>Alice</td>
</table>
"Name: Alice"
Structured Content

Lists (<ul>, <ol>) announce item count. Tables need <th> headers so cells are announced with their column/row header. Don't use tables for layout — only for tabular data.

03

Keyboard Navigation

Many users can't use a mouse. Everything must be operable via keyboard alone.

1 ●
2
3
4
TabMove to next focusable elementShift+TabMove to previous elementEnterActivate buttons and linksSpaceToggle checkboxes, activate buttons
Focus and Tab Order

Users navigate with Tab (forward) and Shift+Tab (backward). Native elements (<button>, <a>, <input>) are focusable by default. The blue outline shows which element is focused.

Bad: Focus hidden
:focus {
  outline: none;
}
Keyboard users can't see where they are!
Good: Custom focus style
:focus-visible {
  outline: 3px solid blue;
  outline-offset: 2px;
}
Replace, don't remove. -visible = keyboard only.
Never Hide Focus Indicators

Never use outline: none without a replacement. The focus indicator is essential for keyboard users. Use :focus-visible to show focus only for keyboard navigation, not mouse clicks.

Modal Dialog
Focus should be trapped inside this modal.
Confirm
Cancel
Tab cycles within modal: Close → Content → Confirm → Cancel → Close...
Escape closes. Focus returns to trigger element.
Modal Focus Management

When a modal opens: move focus inside, trap focus so Tab cycles within the modal, close on Escape, return focus to the trigger when closed. This prevents users from getting lost behind the modal.

Skip to main content
Main content
<a href="#main" class="skip-link">Skip to main content</a>
...
<main id="main">...</main>
Skip to Main Content

Skip links let keyboard users bypass repetitive navigation. The first Tab press should reveal a "Skip to main content" link. It's visually hidden until focused, then jumps focus past the nav to main content.

04

Color & Contrast

Sufficient contrast ensures text is readable. Never rely on color alone to convey meaning.

Text on white
4.5:1 ✓
Text on white
2.8:1 ✗
Large text
3:1 ✓
AA Requirements: Normal text = 4.5:1, Large text (18px+) = 3:1
AAA Requirements: Normal text = 7:1, Large text = 4.5:1
WCAG Contrast Requirements

WCAG Level AA requires 4.5:1 contrast for normal text, 3:1 for large text (18px+ or 14px bold). Level AAA is stricter. Use tools like WebAIM Contrast Checker or browser DevTools.

Bad: Color only
Status shown only by color
Good: Color + icon/text
✕Error
✓Success
Don't Rely on Color Alone

8% of men are color blind. Red/green is most common. Always provide a secondary indicator: icons, text labels, patterns, or underlines. Links should be underlined, not just colored differently.

Input needs visible boundary
Email address
Button needs visible boundary
Submit
WCAG 2.1: UI components need 3:1 contrast against adjacent colors. This includes input borders, button boundaries, and focus indicators.
Component Boundaries

WCAG 2.1 added requirements for UI components: interactive elements must have 3:1 contrast against their background. This means input borders, button edges, and focus indicators must be clearly visible.

05

Images & Media

Images need alt text. Videos need captions. Audio needs transcripts. Make media accessible to everyone.

🐕
Bad: "dog.jpg" or "image"
Good: "Golden retriever playing fetch in a park"
📊
Bad: "chart" or "data visualization"
Good: "Sales increased 40% from Q1 to Q4 2024"
🎨
Decorative image? Use alt=""
Empty alt tells screen readers to skip it
Writing Good Alt Text

Alt text describes the purpose, not just appearance. For informational images, describe what's happening. For charts, describe the data story. For decorative images, use alt="" to skip them.

Informative (needs alt)
• Product photos
• Infographics & charts
• Images in articles
• Screenshots
• Logos with text
Decorative (alt="")
• Background patterns
• Spacer images
• Purely aesthetic elements
• Icons next to text labels
• Redundant images
When to Use Empty Alt

Not every image needs alt text. Decorative images that add no information should use alt="". This tells screen readers to skip them entirely, reducing noise for users.

Video Requirements
• Captions — synchronized text of spoken content
• Audio descriptions — narration of visual information
• Transcript — full text alternative
Audio Requirements
• Transcript — full text of audio content
• Speaker identification for podcasts/interviews
Captions and Transcripts

Videos need captions for deaf users. Pre-recorded videos also need audio descriptions for blind users (describing visual action). Podcasts need transcripts. Auto-captions are a start but need human review.

06

ARIA Basics

ARIA adds accessibility information when HTML alone isn't enough. But the first rule: don't use ARIA if native HTML works.

Unnecessary ARIA
<div role="button"
  tabindex="0"
  onclick="..."
  onkeydown="...">
  Click me
</div>
Just use HTML
<button>
  Click me
</button>

// Keyboard handling is free!
Don't Use ARIA When HTML Works

Native HTML elements come with built-in accessibility: focus handling, keyboard events, screen reader announcements. ARIA can't add these — it only adds labels. Use HTML first, ARIA only when necessary.

aria-label: inline label
<button aria-label="Close dialog">✕</button>
Screen reader: "Close dialog, button"
aria-labelledby: reference visible text
<h2 id="cart-title">Shopping Cart</h2>
<nav aria-labelledby="cart-title">...</nav>
Screen reader: "Shopping Cart, navigation"
aria-label and aria-labelledby

aria-label provides an accessible name directly. aria-labelledby points to visible text elsewhere. Use these when there's no visible label, or when the visible text is insufficient.

aria-expandedDropdown open/closed state
aria-hiddenHide from screen readers (decorative icons)
aria-disabledVisually disabled but still focusable
aria-liveAnnounce dynamic changes ("polite" or "assertive")
aria-expanded, aria-hidden, aria-disabled

ARIA states communicate dynamic information. aria-expanded tells screen readers if a menu is open. aria-live announces changes without focus (like "Item added to cart").

<div aria-live="polite">
  {dynamic content here}
</div>
polite
Waits until user is idle. Use for most updates.
assertive
Interrupts immediately. Use for errors only.
Announcing Dynamic Content

aria-live regions announce content changes to screen readers. "polite" waits for a pause — use for most things. "assertive" interrupts immediately — use sparingly for critical errors.

Part H

Self-Assessment

15

Self-Assessment

Test your understanding of Accessibility Fundamentals. Click each question to reveal the answer.

Q1

What contrast ratio does WCAG AA require for normal text?

Click to reveal
Q2

What should you use for a decorative image that adds no information?

Click to reveal
Q3

Why is semantic HTML important for accessibility?

Click to reveal
Q4

What's the first rule of ARIA?

Click to reveal
Q5

How can keyboard users skip repetitive navigation?

Click to reveal
Q6

When should you use aria-live="assertive"?

Click to reveal

Key Takeaways

Use semantic HTML elements
<button><nav><main>

Use button, nav, main, header, footer — not div for everything. Semantic elements provide meaning and keyboard behavior for free.

Everything works via keyboard
TabEnterEsc

Unplug your mouse and test. Every interactive element must be reachable via Tab, activatable via Enter/Space, and dismissable via Escape.

Never hide focus indicators
Button (focused)

If you remove the default outline, you MUST add a visible replacement. Use :focus-visible to show focus only for keyboard users.

4.5:1 for text, 3:1 for UI
4.5:1
✓

Use tools to check contrast ratios. WCAG AA requires 4.5:1 for normal text, 3:1 for large text and UI components.

Describe purpose, not appearance
alt="Sales increased 40% in Q4"

Alt text describes what the image communicates, not what it looks like. For decorative images, use alt="" to skip them.

Test with real assistive technology
VoiceOverNVDAaxe

Automated tools catch ~30% of issues. Test with keyboard only, then with a screen reader. Listen to your page.