On this page

WCAG in Practice

Fix the barrier#

Do not memorize every criterion first. Start from a broken task, then map the fix.

Contrast#

Interactive demo

Contrast check

Contrast checker

Normal text sample — body copy at typical size.

Large text sample — 18pt / 14pt bold.

Contrast ratio: 17.40:1

AA normal (4.5:1)
Pass
AA large (3:1)
Pass
AAA normal (7:1)
Pass

Color-only cues#

Interactive demo

Color is not enough

Color-only: the red border is the only error cue. Toggle to add text and programmatic description.

Instructions
Toggle between color-only and text + color error cues.

Names and controls#

BadNo accessible name

<input type="text">

GoodLabel association

<label for="email">Email</label>
<input id="email" type="text">
Visible text must map to an accessible name. Labels do that for inputs.

Interactive demo

Div vs button

Compare implementations

Try Tab through the page. The styled div is not in the tab order and has no button semantics.

Save

Activations: 0 (pointer only unless you rebuild keyboard support)

Markup
<div class="button" onclick="...">Save</div>
Role
generic (no button role)
Name
not exposed as a control name
Keyboard
not focusable by default; no Enter/Space contract
Behavior
must be rebuilt: role, focus, keys, and state
Instructions
Compare keyboard and semantics.

Test

Test
ActionExpect
Reproduce barrierTask fails for a real method
Patch semantics/UIName, role, contrast, or keyboard path fixed
Re-testKeyboard + inspection confirm the fix