Skip to content

Latest commit

 

History

History
29 lines (20 loc) · 748 Bytes

image-has-alt.md

File metadata and controls

29 lines (20 loc) · 748 Bytes

RailsAccessibility/ImageHasAlt

Rule Details

Images should have an alt prop with meaningful text or an empty string for decorative images.

Resources

Examples

Incorrect code for this rule 👎

<%= image_tag "spinners/octocat-spinner-16px.gif", size: "12x12" %>

Correct code for this rule 👍

<!-- good -->
<%= image_tag "spinners/octocat-spinner-16px.gif", size: "12x12", alt: "GitHub Logo spinner" %>
<!-- also good -->
<%= image_tag "spinners/octocat-spinner-16px.gif", size: "12x12", alt: "" %>