Skip to content

Latest commit

 

History

History
42 lines (30 loc) · 1.17 KB

no-redundant-image-alt.md

File metadata and controls

42 lines (30 loc) · 1.17 KB

No redundant image alt

Rule Details

<img> alt prop should not contain image or picture as screen readers already announce the element as an image.

This rule does not discourage conveying the medium of the image which may be considered important to help a user better understand the content. For example, this rule will not flag terms including screenshot, painting, or photograph.

Resources

Examples

Incorrect code for this rule 👎

<img alt="picture of Mona Lisa" src="monalisa.png">
<!-- also bad -->
<img alt="image of a fluffy dog" src="monalisa.png">

Correct code for this rule 👍

<!-- good -->
<img alt="Mona Lisa" src="monalisa.png">
<!-- also good -->
<img alt="The original painting of Mona Lisa hangs on the wall of Louvre museum" src="monalisa.png">
<!-- also good -->
<img alt="Screenshot of the user profile Settings page, with the 'Notifications' item highlighted" src="settings_page.png">