Skip to content

Instantly share code, notes, and snippets.

@davatron5000
Last active December 12, 2015 05:09
Show Gist options
  • Save davatron5000/4719835 to your computer and use it in GitHub Desktop.
Save davatron5000/4719835 to your computer and use it in GitHub Desktop.

How-to: Use TITLE attributes

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 unncessary, 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.

Further reading

@Wilto
Copy link

Wilto commented Feb 6, 2013

+1

@davatron5000
Copy link
Author

Also, for increased transparency, my personal blog uses title attributes in the dumbest places. Like a scumbag.

@ckundo
Copy link

ckundo commented Feb 6, 2013

Here's another resource from the Paciello group that shows screen reader support for title attributes: http://www.paciellogroup.com/resources/articles/WE05/forms.html

@grayghostvisuals
Copy link

you people make me sick. 👍

@davatron5000
Copy link
Author

@ckundo - I love that chart but it seems the data (and choice of other screen readers?) might be too out of date. Might be cool to re-run that test against WebAIM's survey results for primary screen readers.

@Arty-chan
Copy link

rather than redundant or unnecessary, according to this article, the title attribute is generally not read by default (except in forms and i/frame) unless they change the setting. Admittedly the article a little old, but from what I've been told by those with some experience of screen readers, it still holds true.

http://www.rnib.org.uk/professionals/webaccessibility/wacblog/Lists/Posts/Post.aspx?id=38

@heitzke
Copy link

heitzke commented Apr 6, 2013

@Arty-chan agreed. Screen readers that I've used entirely ignore the title attribute (out of the box anyway).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment