Dostępność

a11y/page-title

Every HTML document has a title element that says what the page is about.

poważnastatyczneWCAG 2.4.2 · Afe-html

Dlaczego

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.

Poprawka

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.

Przykłady

<!-- bad -->
<head><meta charset="utf-8"></head>
<!-- good -->
<head><meta charset="utf-8"><title>Checkout – Example Shop</title></head>

Źródła

Fakty

Identyfikator
a11y/page-title
Waga
poważna
Sprawdzanie
statyczne sprawdzane w kodzie źródłowym przez audit
Dotyczy plików
html astro
WCAG 2.2
2.4.2, poziom A
Ten sam problem w
axe-core document-title
Uczy jej skill
fe-html HTML documents and semantics
Od wersji
0.1.0

Plik reguły na GitHubie

Przeczytaj w terminalu

npx github:dawidolko/frontend-skills explain a11y/page-title