0

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?

  • I voted to close this question because it is not a programming question and it is off-topic on Stack Overflow. Non-programming questions about your website should be asked on [webmasters.se]. In the future, please ask questions like this there. – Stephen Ostermiller Jan 22 '22 at 00:28

2 Answers2

0

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.

andrzejwp
  • 922
  • 4
  • 11
0

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”.

the Tin Man
  • 158,662
  • 42
  • 215
  • 303