Bristol Web Designer

Website design Blog

Accessible web design

When displaying images when should you use ALT and TITLE attributes? I was recently asked this and it got me thinking about the what and why.

According to the W3C the ALT attribute is required, but the TITLE attribute is not.

The ALT attribute is used as a text equivalent of the image, i.e. it should convey the same information as the image, and is used by screen readers to give and audio instead of visual representation of a web page. ALT is supposed to be shown only when the image itself is not displayed, for example if you turn off images in your browser. IE/Win shows the ALT text as a tool-tip, but that’s not the correct behaviour according to the spec.

When using the ALT attribute you should be using no more than one or two sentences, if you need more then you can use the LONGDESC attribute to point to a longer description.

The TITLE attribute is an ‘advisory title’ which you can use to convey additional information. TITLE is shown by browsers that support it, even when the image is visible, and even IE uses TITLE instead of ALT, if it’s specified.

It is rarely useful to have the same text in ALT and in TITLE. They are meant for very different purposes.

Comments are closed.