Can I use the same Alt attribute for the preview and for the large product image? Or is it better to set Alt only for large images?
Can I use the same Alt attribute for the preview and for the large product image? Or is it better to set Alt only for large images?
2
Answers
You should consider when the
alt
attribute is used. It’s not only for SEO, as many people think.It is used when a User Agent cannot display the image, refer to this part of HTML 4 spec
It is really useful in the context of WCAG – Web Content Accessibility Guidelines. Please refer to the w3.org documentation for more detail about this topic.
So, to answer your question – you can use the same alt-text for both images, if they actually contain the same information.
If you use a preview image as a thumbnail image of a URL link (or some Lightbox) it’s called a "Functional image". They are used in buttons, links, and other interactive elements. The text alternative for the image should convey the action that will be initiated (the purpose of the image), rather than a description of the image.
For instance, the text alternative should be like “print this page” rather than “(image of a) printer”, “search” rather than “magnifying lens” or “Example.com homepage” rather than “Example.com logo”.