Skip to content
Tutorials Center
My learning

Topics

Lesson 36 of 38 ยท Projects and Practice

Project: Fix a Broken Page

Hands-on project: audit a deliberately inaccessible landing page, list the WCAG failures, then repair it step by step with semantic HTML, labels, contrast and focus.

The best way to learn accessibility is to fix real problems. In this project you get a small landing page that looks fine and is broken in about fifteen ways. You will find the problems with the techniques from this track, then repair them. Try to find the issues yourself before you read the answer list.

Step 1: meet the broken page

Run it, then try the keyboard: Tab through it, press Enter on the "buttons", and zoom to 200%.

Broken landing page

Step 2: audit checklist

Write down every problem and the criterion it breaks. Here is a hint list of areas to inspect:

  • Document language, title and landmarks.
  • Navigation: what element types are used?
  • Heading structure.
  • Image alt text.
  • The call to action.
  • The email field: label, focus, error.
  • Contrast of the subtitle and small text.
  • Link text and link styling.
  • Text size and units.

Step 3: the problem list

# Problem Criterion
1 No <!doctype>, lang or <title> (not visible in the snippet, but check in a full page) 3.1.1, 2.4.2
2 Navigation is spans with click handlers: not focusable, no role 2.1.1, 4.1.2
3 No <header>, <nav>, <main> landmarks 1.3.1, 2.4.1
4 "Learn to bake" is a div, not a heading 1.3.1
5 Image has no alt 1.1.1
6 The call to action is a span: not keyboard reachable, no role 2.1.1, 4.1.2
7 Input has a placeholder but no label 3.3.2, 1.3.1
8 outline: none on the input removes the focus indicator 2.4.7
9 Input border #ddd has about 1.4:1 contrast 1.4.11
10 The "!" error is only red and has no text 1.4.1, 3.3.1
11 Subtitle #aaa on #f0f0f0 is about 2:1 1.4.3
12 Small text is 11 px in #999 1.4.3, 1.4.4
13 Link has no underline and weak color; text "Click here" is vague 1.4.1, 2.4.4
14 Font sizes in px; no input purpose (autocomplete) 1.4.4, 1.3.5
15 No skip link 2.4.1

Step 4: the repaired page

Read it alongside the table. Every change is small, and together they turn the page into something that works for keyboard, screen reader and low-vision users.

Repaired landing page

Check a few of the decisions:

  • The subtitle color #4a4f55 on #f0f0f0 is about 7:1.
  • The hero image gets alt text because the mood supports the page; if it were pure decoration you would use alt="".
  • The skip link is hidden off screen until focused, then shown with a visible outline.
  • aria-invalid with aria-describedby makes the error part of the field; a real form would set it only after a failed submit.
  • Text sizes are in rem, so they grow with the browser setting.

Step 5: re-test

Repeat the checks: Tab order, focus rings, 200% and 400% zoom, grayscale, contrast with a checker, headings outline, run axe on both versions (see automated testing) and compare the reports.

Stretch goals

  1. Add a <footer> with a link to an accessibility statement.
  2. Make the "Start now" button open a native <dialog> with a sign-up form (see modals).
  3. Add prefers-reduced-motion handling to a hero animation of your own.
  4. Write three accessibility acceptance criteria for the page.

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. Which change fixes a span that acts like a button?

    A native button has focus, role, keyboard activation and a name from its text.
  2. 2. Why is outline: none on an input a problem?

    Keyboard users need to see where focus is (2.4.7); use :focus-visible styles instead.
  3. 3. Which is a better link text than 'Click here'?

    Descriptive link text makes sense out of context, such as in a screen reader's link list.
  4. 4. What does a skip link do?

    It is the first focusable link and targets the main content, satisfying 2.4.1 Bypass Blocks.

Summary

  • Audit by keyboard, zoom, grayscale and the accessibility tree, then map each failure to a criterion.
  • Replace fake controls with native elements, add landmarks, headings, labels and alt text.
  • Restore focus indicators, fix contrast and use relative units.
  • Re-test and compare with automated reports.

Next: Project: Build an Accessible Sign-up Flow