How–to: Use TITLE attributes
Edit on GitHub Published on
Short answer: Don’t use them, except in special circumstances.
HTML
title
attributes are often perceived as an accessibility (and SEO) bonus, but the opposite is true. For screen reader users the content included inside of the
title
attribute is typically unnecessary, redundant,
and
possibly not even used
. Conversely, content being put in the
title
attribute is being hidden from the (probable) majority
of your users. If information is being hidden from the majority of your users, then it’s probably not necessary.
There are a few times when using a
title
attribute is appropriate:
-
For
<frame>and<iframe>elements - For providing a label when a text label would be redundant
Rule of Thumb: Serve all users equal content.
More Text Without Code Elements
One of the great things about the internet is the ability to share video. With HTML5 we can now use video without the use of Flash. This makes video more accessible as the controls are located in the DOM. However, to do accessible video right, you need to include captions and transcripts.
In addition to making video accessible to those with hearing issues, having a transcript on the page can provide you localization of a video not always available in the local language. With a transcript on your page, you may increase your search engine rankings by making your content easily indexed by search engine crawl spiders.
So how do we pull off putting captions into a video after the video has been produced? Fortunately the HTML5 video tag has a solution for us. We have to provide a transcript file in either XML ot a VTT as a track element after your video source files.
Further reading
- “Using the HTML title attribute” by Steve Faulkner (Jan 15th, 2013)
- RNIB Blog: TITLE attributes (May 16th, 2007)