alt-require
Alt of img
must be present and alt of area[href]
and input[type=image]
must be set with a value.
Level: Warning
Config value
Section titled “Config value”true
: enable rulefalse
: disable rule
The following patterns are not considered rule violations
Section titled “The following patterns are not considered rule violations”<img src="test.png" alt="test" /><input type="image" alt="test" /><area shape="circle" coords="180,139,14" href="test.html" alt="test" />
The following patterns are considered rule violations
Section titled “The following patterns are considered rule violations”<img src="test.png" /><input type="image" /><area shape="circle" coords="180,139,14" href="test.html" />
Why this rule is important
Section titled “Why this rule is important”The alt attribute is used to provide alternative text for images, which helps improve accessibility for users who cannot see the image. It also helps with SEO by providing context for the image.