Lesson 24 / Accessibility
Web Accessibility
Apply accessibility principles, semantic HTML, keyboard support, contrast, ARIA, and testing practices to build inclusive websites.
Teacher Notes / In-Class Use
Demo Live
- Use the accessibility lab to toggle one issue at a time and connect each failure to a user impact.
- Run a keyboard-only pass before talking about automated audits.
Try In Class
- Have students navigate their project without a mouse and write down the first place they get stuck.
- Ask students to check body text, link, and button contrast before final visual polish.
Submit Or Check
- Projects should have semantic structure, visible focus, useful alt text, labels, and sufficient contrast.
- Automated tools can support the review, but students should also perform manual keyboard testing.
Watch For
- Students treating Lighthouse as the whole accessibility process.
- Interfaces that rely on color alone to communicate state.
Learning Goals
- Explain why accessibility matters
- Describe the POUR principles
- Apply an accessibility checklist to student projects
- Test a project with keyboard, contrast, and audit tools
Interactive Demo
How to use this demo.
Use the demo as a small lab. Change one thing, observe the result, then connect it back to your own project.
What To Try
- Toggle each accessibility issue and watch the preview, checklist, and code change.
- Use the preview like a mini audit before checking your own project.
What Changes
- The same UI becomes more or less accessible based on markup, contrast, focus, and control choices.
- The checklist turns abstract accessibility language into concrete checks.
What To Notice
- Accessibility problems often come from small implementation choices.
- Manual testing catches issues that automated tools may miss.
Apply It
- Run the same checks against your own project: alt text, contrast, focus, and semantic controls.
Interactive Demo
Accessibility Check Lab
Toggle common accessibility issues and watch the checklist update. The goal is to practice noticing problems before they ship.
Student Project Feature
This paragraph has enough contrast to stay readable for more people.
- Alt text: Pass
- Contrast: Pass
- Focus style: Pass
- Semantic control: Pass
<img src="project.jpg" alt="Student project preview">
<button type="button">Save project</button> What to notice
- Accessibility issues often look small but change who can use the page.
- Native HTML solves many problems before ARIA is needed.
- Visible focus and contrast are part of the interface design.
Try this
- Turn off one checkbox and explain what broke.
- Use the Tab key to test focus visibility.
- Apply the checklist to a page from your own project.
This demo uses extra JavaScript for teaching. The code sample shows the pattern to practice. View full demo source (opens in a new tab).
Introduction
This section explores the essential principles and practices of making web content accessible to all users, including those with disabilities.
You'll learn why accessibility matters, how to apply the POUR principles, and how to test and refine your project for accessibility compliance.
It covers semantic HTML, keyboard navigation, form accessibility, color contrast, ARIA, and more, ensuring you can build inclusive, user-friendly websites.
The Why: The Core Principles of Accessibility
At its core, web accessibility is guided by a few key principles.
These principles form the foundation of accessible design, encapsulated in the acronym POUR.
- Perceivable: Information and UI components must be presented in ways users can perceive, including text alternatives and adaptable content.
- Operable: Navigation and interactions must be keyboard-accessible and user-friendly.
- Understandable: Content and interface behavior should be easy to comprehend and predict.
- Robust: Content should work reliably across various technologies, including assistive tools.
The How: Navigating the Accessibility Guidelines
WCAG is the international standard for web accessibility.
For student projects, Level AA of WCAG 2.1 is the recommended goal.
- Guidelines: Broad principles for accessibility.
- Success Criteria: Specific, testable requirements categorized into levels A, AA, and AAA.
Key Areas of Focus: Your Accessibility Checklist
- Semantic HTML: Use elements like nav, article, and correct heading hierarchy.
- Alternative Text: Provide descriptive alt attributes for images.
- Keyboard Navigation: Ensure all interactive elements can be accessed via keyboard with visible focus.
- Form Accessibility: Use properly linked label elements, ARIA where needed, and clear instructions.
- Color Contrast: Maintain at least 4.5:1 contrast ratio for normal text and avoid relying solely on color.
- ARIA: Use ARIA roles and attributes only when native HTML isn't sufficient.
- Language: Set the lang attribute correctly on the html tag and within content.
- Time-Based Media: Include captions, transcripts, and controls for media.
- Readability: Write clearly, use accessible fonts and spacing.
Semantic HTML Example
<header>
<nav aria-label="Main menu">
<a href="/">Home</a>
<a href="/about">About</a>
</nav>
</header>
<main>
<article>
<h1>Accessible Page Title</h1>
<p>Page content goes here.</p>
</article>
</main> Form Accessibility Example
<label for="email">Email address</label>
<input
id="email"
name="email"
type="email"
autocomplete="email"
aria-describedby="email-help"
>
<p id="email-help">Use the email address you check most often.</p> Testing Your Project for Accessibility
- Test with only the keyboard.
- Try using a screen reader.
- Check color contrast with online tools.
- Run browser accessibility audits, such as Lighthouse.
- Use WCAG checklists for structured review.
The Final Push: Making Accessibility a Priority
Accessibility should be baked into your process from the start.
Making it a habit demonstrates professionalism and care in your work, creating digital experiences that are truly inclusive.
Checkpoint
Before moving on, make sure these feel true.
- I can test a page using only the keyboard.
- I can check contrast, labels, alt text, and heading structure.
- I can explain why automated audits do not replace manual testing.
Project Connection
This lesson supports current class projects.
Practice
- Navigate your project using only the keyboard.
- Check the contrast of your body text, links, and buttons.
- Review every image for useful alt text.
- Run Lighthouse and fix at least one accessibility issue.