1

If an image is featured on a landing page and isn't a hyperlink, is it still relevant to make use of the title attribute?

I'm seeing less and less websites make use of it and with mobile websites it's completely redundant - am I missing a particular use case?

1
  • Totally unnecessary these days. silktide.com/… It's only useful for tooltips for visual users who are using a mouse. And really, if they're fully sighted then what additional content in a tooltip over an image is going to be useful for them and not anyone else?
    – JonW
    Commented Jun 5, 2018 at 10:35

1 Answer 1

4

The correct attribute for providing a textual alternative to an image is alt. Including an alt attribute is a requirement of the HTML standard, but it's not required that the alt attribute contains content (alt="" is acceptable if the image is purely decorative and contains no meaningful content).

title, meanwhile, is purely optional and always has been - it can implement a simple tooltip, if that's something you'd like to do (bear in mind that it won't work on touchscreen devices, though).

See also WebAIM's guidance (emphasis in original):

Every image must have an alt attribute. This is a requirement of HTML standard (with perhaps a few exceptions in HTML5). Images without an alt attribute are likely inaccessible. In some cases, images may be given an empty or null alt attribute (e.g., alt="").

Note that the "few exceptions" refers to a fairly unusual situation mentioned in the W3C HTML spec where figcaption is already used to provide a caption, and where "the author is unable to provide an appropriate text alternative", and even then "Such cases are to be kept to an absolute minimum. If there is even the slightest possibility of the author having the ability to provide real alternative text, then it would not be acceptable to omit the alt attribute."

2
  • Welcome to UX.SE! Thanks for the answer. Would you mind editing your answer to include a short excerpt from the article you linked? That would help to preserve this answer's usefulness in the event that the article moves or otherwise becomes unavailable. Commented Jun 5, 2018 at 13:41
  • @maxathousand Done and done. Commented Jun 7, 2018 at 0:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.