area-alt
Angular templatesHTMLVue / SvelteVue / Sveltecorrectnessno fixdefault: offhtml/html-validate-standard
What it does
Section titled “What it does”Reports an <area> that has an href and no non-empty alt, and an <area> that has an alt but no href.
Why it matters
Section titled “Why it matters”The alt of an <area> is the name of its link in the image map, and the only text a screen reader has for it. An alt on an area with no href names nothing, because the area is not a link.
To fix, give each linked area an alt that says where the link goes, and remove the alt from areas without an href.
Example
Section titled “Example”...<input type="text" aria-label="d"><input type="hidden" name="e">...<map name="m"><area href="x"><area href="y" alt="ok"><area alt="z"></map>...<svg focusable="false"></svg>...Configuration
Section titled “Configuration”angular: lint: rules: area-alt: warn # off (default), warn, errorhtml: lint: rules: area-alt: warn # off (default), warn, errorsvelte: lint: rules: area-alt: warn # off (default), warn, errorvue: lint: rules: area-alt: warn # off (default), warn, errorEnabled by the presets: html/html-validate-standard.
Suppress one line with sudsy-disable-next-line area-alt in a comment of the file’s language.
Upstream equivalents
Section titled “Upstream equivalents”The same check in other tools. full: Sudsy reports what the upstream rule reports; partial: only part of it, as the last column says.
| Tool | Rule | Match | What differs |
|---|---|---|---|
| html-validate | area-alt |
partial | each area is checked alone, without the accessible option or the alt of an area with the same target |