-5

I have a question about my Stack Overflow post: How to update/re-render component only after last XHR completed?

Why when you add the picture's description in the braces, you don't see this description in post, not image with description in pretty format?

For example:

Example

2
  • 3
    The text you have added there as image description (I need to update component only on 2 XHR complete, but now it updates on each XHR completing and the last data in component is from 1 XHR, because it takes more time to complete) is not a description of the image anyway. this is intended for accessibility purposes AFAIK Apr 8, 2019 at 11:30
  • 1
    As far as I'm aware, image descriptions are placed into the <img> tag's alt attribute, which is primarily used when the image doesn't load or for people using accessibility tools such as screen readers (I think alt attributes can also be used for SEO but I doubt that is a factor here). The description should describe what is in the picture, not why you have used the picture. Apr 8, 2019 at 12:59

1 Answer 1

7

Martin is correct: The image description is what becomes the alt text in the image tag. The alt text is read by screen readers and is only visible if the image does not load. It doesn't appear as a caption because it's only meant for users who can't see the image.

If you'd like to learn more, read WebAIM: Alternative Text which describes how to write useful alternative text.

You can always just add a description of the image above or below the image itself as normal text if you want but:

  • Don't do this and add alt text; it's redundant.
  • I recommend only doing that in a way where it flows with the rest of the question. Otherwise, you risk someone mistakenly removing it as noise.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .