Skip to: content, navigation

by Ian Lloyd

longdesc (HTML attribute)

Browser support full matrix
IE5.5+ FF1+ Saf1.3+ Op9.2+
Partial Partial Partial Partial
Spec
Depr. Version
No HTML 2
longdesc="uri"

Example

This longdesc attribute refers to a text file "prawn.txt":

<img src="giant-prawn.jpg" alt="The Giant Prawn at Ballina"
    longdesc="prawn.txt"/>

Description

The alt attribute is intended to be a short alternative for the image, and shouldn’t be used for lengthy descriptions of the image. The attribute that’s used to provide a pointer to further information is longdesc. Unfortunately, it’s so poorly supported that it’s almost unusable (see below for more information).

Value

This attribute takes as its value the URL for a file that contains the extra descriptive text, most likely a simple .txt file.

Compatibility

IE5.5Partial
6.0Partial
7.0Partial
Firefox1.0Partial
1.5Partial
2.0Partial
Safari1.3Partial
2.0Partial
3.0Partial
Opera9.2Partial

The longdesc attribute has almost no practical use, even with today’s good, standards-aware browsers. Despite the best intentions, no browser on the support charts makes it clear to the user when extra information is available for the image in the form of a descriptive text file, and this level of indifference toward the attribute is likely to continue. Even the technology that would benefit the most from the presence of this attribute—assistive technology such as screen readers—is oblivious to the presence of a longdesc. Only Firefox appears to show a basic level of awareness of the attribute: if you right-click on the image and choose Properties, the longdesc’s file location is visible next to the Description title, as shown in Figure 1.

Figure 1. The longdesc shows in Firefox’s contextual menu as the Description The longdesc shows in Firefox's contextual menu as Description

A much safer option is to avoid this attribute altogether, and simply to create a link that anyone can access or see, perhaps linking from picture caption text.

User-contributed notes

There are no comments yet.

Add a note

To post a note on this topic, please log in with your SitePoint username and password. If you don't have an account yet, you can create a new account for free.

Related Products

The Principles of Beautiful Web Design

Best Seller!

You don’t need to go to Art School to design great looking web sites!

Book Cover: The Principles of Beautiful Web Design

Download the FREE sample chapters