WebAIM - Web Accessibility In Mind

E-mail List Archives

RE: caption?

for

From: Jukka Korpela
Date: May 5, 2002 11:37PM


Raja Saravanan wrote:

> I guess you can try the label tag for that
>
> <label FOR="myImage"> <<your caption here>> </label>
>
> <img id="myImage" src="../../img001.jpg" alt="My photo">

That's an interesting idea, but unfortunately the <label> element is for
specifying labels for form fields (or "controls", to use the HTML 4 jargon)
only. There's no definition of what it should mean for images, for example,
and no consistent treatment by browsers.

Unfortunately there is no structured markup for image captions in HTML.
Usually authors use a table, with the image in one cell and the caption text
in another cell below it:

<table>
<tr><td><img alt="..." src="..."></td></tr>
<tr><td>Your caption here</h></tr>
</table>

(Probably to be accompanied with presentational attributes and/or CSS rules
to tune the visual appearance.)

This might even be regarded as "tabular data", or genuine (structural)
table, stretching a bit; it would then be logical to use <th> markup for the
cell containing the caption. But in practical terms, it wouldn't help much,
I'm afraid. The visual appearance might give sufficient clue of the intended
relationship, but non-visual user agents couldn't deal with it very well.

--
Jukka Korpela
TIEKE Tietoyhteiskunnan kehitt