longdesc (HTML attribute)

Depr. Version
Browser support (more…)
IE8 FF1+ SA4 OP10 CH2
None Partial None None None




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).


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

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


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


Internet Explorer Firefox Safari Opera Chrome
5.5 6.0 7.0 8.0 1.0 1.5 2.0 3.0 3.5 1.3 2.0 3.1 4.0 9.2 9.5 10.0 2.0
None None None None Partial Partial Partial Partial Partial None None None None None None None None

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 demonstrate even 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

Related Products