HTML and accessibility
Semantic markup, forms and accessibility that works with a keyboard and screen readers.
17 lessons 54 practice questions about 1 hours of reading
Chapter 1, beginner
Foundations
What it is and how it works, the questions every round starts with.
- 01b vs strong and i vs em in HTML: what is the difference?
Lesson, 5 min read, then 3 questions to practise
- 02div vs span: what is the difference?
Lesson, 5 min read, then 4 questions to practise
- Fix a div-soup form so it works with a keyboard and screen readers
- List a page's landmarks with getLandmarks(): implicit roles, accessible names and document order
- Compute the keyboard tab order: positive tabindex first, then DOM order, skipping disabled, hidden and inert elements
- Build a polymorphic Button with an as prop, ref forwarding and correct semantics for each element
- 03script async vs defer: what is the difference?
Lesson, 4 min read, then 5 questions to practise
- Put the steps from typing a URL to first paint in order, and mark what blocks rendering
- Choose resource hints for a landing page: preload, preconnect, prefetch, modulepreload and fetchpriority
- Diagnose and fix a poor LCP on a product page
- Prefetch route code on intent without wasting bandwidth
- Build a polyfill loader that feature-detects and loads only what is missing, in dependency order
- 04Visually hidden (sr-only) CSS for screen reader text
Lesson, 4 min read, then 3 questions to practise
- 05What are data attributes in HTML?
Lesson, 3 min read, then 4 questions to practise
- 06What are meta tags in HTML, and which ones matter?
Lesson, 7 min read, then 2 questions to practise
- 07What are the new features in HTML5?
Lesson, 4 min read, then 6 questions to practise
- Mark up an accessible signup form with labels, a fieldset, hints and error messages
- Style an FAQ accordion with details and summary, including a rotating marker
- Embed a responsive 16:9 video and crop images to fit with aspect-ratio and object-fit
- Implement a Web Worker for CPU-intensive computation
- Implement useLocalStorage() with serialization and cross-tab updates
- Open a <dialog> with commandfor and command, and add a fallback for browsers without invoker commands
- 08What does the DOCTYPE do in HTML?
Lesson, 3 min read, then 4 questions to practise
- 09What does the meta viewport tag do?
Lesson, 3 min read, then 4 questions to practise
- Switch a card's layout with CSS container queries and prove it by measuring three container widths
- Fix layout shifts from ads, web fonts, images and late banners
- Audit small touch targets with auditTargets(): the WCAG 2.5.8 size and spacing rule
- Build a holy-grail layout with CSS Grid that stacks in narrow containers
- 10What is semantic HTML, and why does it matter?
Lesson, 4 min read, then 2 questions to practise
Chapter 2, intermediate
In depth
How it behaves under the hood, and the follow-ups that come next.
- 11
- 13How do you make forms accessible?
Lesson, 7 min read, then 4 questions to practise
- Validate a form with the Constraint Validation API: setCustomValidity, custom messages and aria-invalid
- Wire repeated address fields with useId: labels, hints, errors and aria-describedby
- Style form validation states with :user-invalid, :placeholder-shown and :focus-visible
- Build a useAnnouncer() hook for screen-reader live announcements
- 14How do you manage focus and ARIA in custom modals and dropdowns?
Lesson, 6 min read, then 4 questions to practise
- Design an accessible modal dialog component for a design system
- Design an accessible dropdown menu and popover component
- Build a modal dialog in plain JavaScript: Escape, backdrop clicks, focus return and scroll lock
- Build a modal stack manager: nested modals, focus restore, scroll lock counting and Escape for the top one
- 15section vs article vs div in HTML: when to use which?
Lesson, 5 min read, then 1 question to practise