Skip to main content

30 steps to a more accessible website

Step 14: Adding titles to links

What with the web being all about links, you would think more people would know about the title attribute, but it is rarely used. For those who don't know, all links can have a title, specified by the title attribute of the <a> tag. This is in addition to whatever link text you specify. The title of a link generally shows up as a tooltip in visual browsers, but it can be presented in non-visual browsers as well.

Not all links should have titles. If the link text is the name of an article, don't add a title; the link text itself is descriptive enough. But if you read the link text by itself, out of context, and can't figure out what it points to, add a title.

Who benefits?

  1. Jackie benefits. JAWS has an option to read the title of a link along with the link text. (This option is not on by default. To activate it, Jackie pressed INSERT+V to bring up the JAWS verbosity options window, then changed "Text links verbosity" to "Alt tag or title".)
  2. Michael benefits. When he moves his cursor over a link in Opera, it displays the title of the link in the status bar and as a tooltip. This lets him decide whether he wants to spend precious bandwidth following the link.
  3. Lillian benefits. When she moves her cursor over the link in Internet Explorer, it displays the title of the link as a tooltip.
  4. Marcus benefits. When Marcus presses "l", Lynx displays a list of links on the current page. The list includes the title of each link, if present.

How to do it

On each link where the link text itself might not be sufficient for the reader to decide whether to click the link, add a title attribute. Examples:

  1. On my navigation bar, I have a link to my statistics page. The link text is simply Statistics, but the title attribute gives some further information:
  • <a title="referrers and other visitor statistics" href="/stats/">Statistics</a>
  • On my navigation bar, I have a link to my book, Dive Into Python, which looks like this:
  • <a title="Free Python book for experienced programmers" href="">Dive Into Python</a>
  • When I link to an article using a phrase within a sentence, I try to use a title attribute to give identifying information about the link, such as the article title or a citation. For instance, the last tip included this sentence:
  • Why is this a problem? Because <a title=" statistics on Javascript usage in browsers, April 2002" href="">11% of internet users don't use Javascript</a> for one reason or another, including many disabled users whose browsers simply don't support it.
  • Which renders like this:

Do not go overboard with the title attribute. All things in moderation.

Further reading

 « Step 13: Using real links | Contents | Step 15: Defining keyboard shortcuts »

This guide is adapted from Dive Into Accessibility by Mark Pilgrim and is shared with the GNU Free Documentation License v1.1