Accessibility
a11y/page-title
Every HTML document has a title element that says what the page is about.
seriousstaticWCAG 2.4.2 · Afe-html
Why
The title is the first thing a screen reader announces and the label of the tab, the history entry and the bookmark. Search engines show it as the result heading.
Fix
Add <title> inside <head>, most specific part first: <title>Checkout – Example Shop</title>. Frameworks set it through their metadata API (Next.js metadata, Nuxt useHead, SvelteKit <svelte:head>); this check reads only plain HTML and Astro documents, and skips a head that renders a component which may set the title.
Examples
<!-- bad -->
<head><meta charset="utf-8"></head>
<!-- good -->
<head><meta charset="utf-8"><title>Checkout – Example Shop</title></head>Sources
Facts
- Id
a11y/page-title- Severity
- serious
- Check
- static checked in the source by
audit - Applies to
htmlastro- WCAG 2.2
- 2.4.2, level A
- Same problem in
- axe-core
document-title - Taught by the skill
fe-htmlHTML documents and semantics- Since version
- 0.1.0
Read it in the terminal
npx github:dawidolko/frontend-skills explain a11y/page-title