Image alt attribute best practices

后端 未结 10 1085
既然无缘
既然无缘 2020-12-20 16:51

What exactly is the intended use of the alt attribute on tags?

Should it describe the image, or should it provide meaningful re

相关标签:
10条回答
  • 2020-12-20 17:02

    Succinctly describe the image, as if you were talking to a blind person. Pretty simple.

    I'm sure this attributes value is used by Google to index Image searches.

    0 讨论(0)
  • 2020-12-20 17:05

    The HTML 5 spec has a huge section on this.

    Basically, the alt attribute should be what would be there as text if you hadn't used an image at all. If your image is purely decorative, you can use alt="". A description goes in the title attribute.

    0 讨论(0)
  • 2020-12-20 17:05

    first hit on google for this [img alt accessibility] gives Consider what the page looks like or sounds like when images are not shown. Then, write for each image an alt text that best works as a replacement (Guidelines on alt texts in img elements)

    0 讨论(0)
  • 2020-12-20 17:11

    if I have a short biography of a person on my website, and include a small photo of them, is it really meaningful to visually impaired users to have "Photo of John Smith" read out to them?

    If you don't have that alt text, what do you think they'll assume the image is? "Photo of John Smith and his wife"? "Photo of John Smith accepting his Oscar"? "Photo of John Smith assassinating JFK"? "Photo of John Smith lying dead on his patio after being murdered by his pet elephant"?

    If it's a photo of John Smith, yes, say so. If it's something else, say so.

    0 讨论(0)
  • 2020-12-20 17:13

    Its provides "alternate" text if the image could not be loaded for some reason. In your example I would say yes it would be appropriate.

    0 讨论(0)
  • 2020-12-20 17:15

    It should be anything that helps the user if the image is not displayed.

    Btw the "feature" of when you hover over an image in IE and the tooltip shows the ALT is not the correct behavior of ALT. Title is supposed to be used for this.

    0 讨论(0)
提交回复
热议问题