alexseanchai: Katsuki Yuuri wearing a blue jacket and his glasses and holding a poodle, in front of the asexual pride flag with a rainbow heart inset. (Default)
let me hear your voice tonight ([personal profile] alexseanchai) wrote in [community profile] marchmetamatterschallenge 2020-03-09 08:33 pm (UTC)

It just occurred to me I forgot something.

What I put in as the image source URL in the failed images above is a legit URL. You can view the image just fine by clicking the link. It's just not the URL to the image itself.

Now, if I want the image to be the clickable thing for a hyperlink, like the words 'a legit URL' are above, I could do <a href="LINK"><img src="IMAGE URL" /></a> and it would work fine—for people who can view the image. Not so helpful for screenreader users or when the image doesn't load.

Here's such an image-as-hyperlink where the image fails as above and there isn't alt text:



And one where there is:

Since this img tag has alt text, one can tell this is a working hyperlink even though the image itself isn't working.

Also, if for whatever reason one wants an image to be present (as a decorative element or whatever) for people who can view images, but not to trouble people who don't, doing like <img src="IMAGE URL" alt="" /> means the screenreader will simply skip it. This is preferable to <img src="IMAGE URL" /> because the screenreader will read the file name, which is most likely unhelpful, and (as you see with my example image) sometimes total gibberish.

Post a comment in response:

If you don't have an account you can create one now.
HTML doesn't work in the subject.
More info about formatting