All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.sonar.l10n.web.rules.Web.ImgWithoutAltCheck.html Maven / Gradle / Ivy

Go to download

Analyze HTML (also within PHP/Ruby/etc. templates) and JSP/JSF code.

The newest version!

The alt attribute provides a textual alternative to an image. It is used whenever the actual image cannot be rendered. Common reasons for that include:

  • The image can no longer be found
  • Slow internet connections, while waiting for the image to download
  • Visually impaired users using a screen reader software
  • Images loading is disabled, e.g. to reduce data consumption on mobile phones

Noncompliant Code Example

<img src="foo.png" />                                           <!-- Non-Compliant -->
<img src="foo.png" alt="" />                                    <!-- Non-Compliant -->
<input type="image" src="bar.png" />                            <!-- Non-Compliant -->

Compliant Solution

<img src="foo.png" alt="Some textual description of foo.png" />
<input type="image" src="bar.png" alt="Textual description of bar.png" />




© 2015 - 2024 Weber Informatics LLC | Privacy Policy