Accessibility Basics
alt text, correct heading order, and colour contrast basics.
What Is Accessibility?
Web accessibility means building sites that people with disabilities — visual, auditory, motor, or cognitive — can actually use. This includes screen reader users, people navigating by keyboard only, and people with low vision or color blindness. Most of it starts with writing good HTML.
WCAG Levels
The Web Content Accessibility Guidelines (WCAG) define three conformance levels. Most legal and organizational standards target AA.
| Level | Meaning |
|---|---|
| A | Minimum — basic accessibility barriers removed |
| AA | Standard target for most websites and legal requirements |
| AAA | Highest — often not achievable for all content types |
Writing Useful alt Text
Good alt text describes the image's purpose, not just its literal contents. Decorative images that add nothing should use an empty alt="" so screen readers skip them entirely.
<!-- Vague --> <img src="chart.png" alt="image"> <!-- Useful --> <img src="chart.png" alt="Revenue grew 40% from Q1 to Q4 2025"> <!-- Purely decorative --> <img src="divider-swirl.png" alt="">
Heading Order & Colour Contrast
Headings should nest in order — never skip from <h2> straight to <h4> just because it "looks" smaller. Screen reader users navigate by heading level, and skipped levels break that outline. Text must also have enough contrast against its background — WCAG AA requires at least 4.5:1 for normal body text.
Given an image with
alt="img" and a heading structure that jumps from h2 to h4, rewrite both: give the image meaningful alt text describing what it shows, and fix the heading to use h3.
💡 Show hints if you're stuck
- Describe purpose, not pixels — "team photo at the 2025 conference," not "photo.jpg".