Accessibility · ARIA
Prohibited ARIA label on an element
An icon on this page is an empty span with aria-label. A span has no role that can take a name, so the label is not allowed and is often ignored.
How this page is built
The warning icon below is an empty span with aria-label="Warning" and no role. The span is generic, so the label is not allowed on it.
Check the label on this icon.
Why it matters
ARIA lets authors give an element an accessible name with aria-label or aria-labelledby. Only some roles can be named, such as links, buttons, form fields, images and landmarks. Plain div and span elements have the generic role, and ARIA prohibits naming them.
Screen readers handle a prohibited label in different ways. Some read it, some skip it, and some read it only in certain modes, so the information it carries reaches some users and not others. Icons built from an empty span are the usual cause.
Accessibility problems matter for search too. Search engines read the same code that screen readers read. Many crawl tools now run accessibility checks next to their SEO checks. A page that works for everyone is easier to use, and people stay on it for longer.
How to check it
Run an automated checker such as axe DevTools, Lighthouse or WAVE, or a crawler with accessibility checks, on this page. axe reports this under the rule aria-prohibited-attr.
To check by hand, search the source for aria-label and aria-labelledby. Each element that carries one should be a link, button, form field, image, landmark or another element with a role that can be named. A div or span with no role cannot be named.
How to fix it
Give the element a role that can be named, such as role="img" for an icon, or remove the label and put the text on the page, for example in a visually hidden span next to the icon.