Skip to main content

image_alt

<img> elements must have a alt attribute, either with meaningful text, or an empty string for decorative images

User impact: Serious

This rule supports the following configuration:

# The `alt` attribute must be present.
image_alt = true

Success#

<!-- Good: Check alt is present -->
<!-- image_alt = true -->
<img src="foo" alt="Foo eating a sandwich." />
<!-- Good: Empty alt is fine too -->
<!-- image_alt = true -->
<img src="foo" alt="" />

Fail#

<!-- Bad: Missing -->
<!-- image_alt = true -->
<img src="foo" />

Resources#