In a website directory, every business has a slideshow with several images. If I don't know what kind of picture is in each case, what should be the best way to handle the alt
attribute for each image/link?
Example (edited)
<ul class="slideshow">
<li>
<a href="img1_full.jpg" ><img src="img1_thumb" alt=""></a>
</li>
<li>
<a href="img2_full.jpg" ><img src="img1_thumb" alt=""></a>
</li>
</ul>
alt="Slideshow image 1 of Business X"
, etc.Since you do not know what the images are, this would be a valid option. It tells someone who is using a screen reader, or for whatever reason cannot see the image (it doesn't load), that the image is part of a slideshow. It also tells which image it is and what business it relates to.
For extra credit, you could use an API such as the Cloud Vision API that can analyze the content of an image and return a short phrase that describes it.