These docs are for CORA 0.10, an older release. Read this page in the newest docs.
Alt text should not repeat the text beside it
- Rule:
axe/image-redundant-alt - Checks: Alternative text of images should not be repeated as text
- WCAG: none; a best practice, not a WCAG success criterion
- Fix class:
content: A fix needs authored text.
Who it affects
Section titled “Who it affects”- People who use a screen reader or a braille display, most of them blind.
How to fix it
Section titled “How to fix it”A link or button holds an image and text that say the same thing
Section titled “A link or button holds an image and text that say the same thing”Set the image to alt="", so the text alone names the control and is heard once.
<a href="/cart"><img src="cart.svg" alt=""> Cart</a>An image in a paragraph, list item or table cell has the same text beside it
Section titled “An image in a paragraph, list item or table cell has the same text beside it”Set alt="" if the image adds nothing to the text. If it shows something the text does not, write the alt for that instead.
Fixes that fail
Section titled “Fixes that fail”Rewording the alt slightly, such as “Cart icon” beside the word “Cart”
Section titled “Rewording the alt slightly, such as “Cart icon” beside the word “Cart””axe compares the exact text, so the report goes away, but people still hear the same thing twice.
More on the rule
Section titled “More on the rule”axe-core’s documentation of the rule
CORA’s fix guidance adapts content from accessibility-agents, under the MIT License: see its notice.