简体   繁体   中英

Сan i use the same Alt attribute for the preview and for the large product image?

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?

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 url link (or some Lightbox) it's called "Functional images". 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”.

https://www.w3.org/WAI/tutorials/images/functional/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM