Skip to content

area-alt

Reports an <area> that has an href and no non-empty alt, and an <area> that has an alt but no href.

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.

Reported
...
<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>
...
angular:
lint:
rules:
area-alt: warn # off (default), warn, error
html:
lint:
rules:
area-alt: warn # off (default), warn, error
svelte:
lint:
rules:
area-alt: warn # off (default), warn, error
vue:
lint:
rules:
area-alt: warn # off (default), warn, error

Enabled 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.

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