Alt Text
An HTML attribute that describes the content/purpose of an image
The alt attribute (more often just referred to as "alt text") is an alternative means to convey information that is otherwise only provided visually in images or icons.
Proper use of alt text is relevant in the following situations:
  • Embedded image text
  • Image links
  • Adjacent alt text
In all cases the alt attribute must always be present, but it can and should have an empty value in certain situations (read on for more details). Removing the alt attribute altogether would result in the screen reader announcing the entire image url, which is not desirable for our users.

Embedded image text

If the image contains text (usually ads and promo banners), we must convey this text in the alt attribute.
1
<img src=”fashion_promo.jpg” alt=”Explore eBay Fashion” />
Copied!

Image links

If an image is a link, its alt text is incorporated as the link text.
1
<a href=”http://www.ebay.com/itm/12345”>
2
<img src=”lumia_950.jpg” alt=”Microsoft Lumia 950” />
3
</a>
Copied!

Adjacent alt text

If the alt text would repeat nearby or adjacent text, we can leave its value empty so that the screen reader will ignore the image.
1
<a href=”http://www.ebay.com/itm/12345”>
2
<img src=”lumia_950.jpg” alt=”” role=”presentation” />
3
<p>Microsoft Lumia 950</p>
4
</a>
Copied!
Remember, removing the alt attribute is not the same as an alt attribute with an empty value. Removing the alt attribute would result in the screen reader announcing the entire image url, which is not desirable.
NOTE: role=presentationprevents our internal eBay WAE tool from flagging this as a missing alt attribute. It is used by the developer to indicate their intentions as deliberate.