WebAIM - Web Accessibility In Mind

E-mail List Archives

Re: Newspaper style captions


From: Terence de Giere
Date: May 13, 2003 9:01AM


Unfortunately, there is no element in HTML that was designed for image
captions. CAPTION is for captioning tables. There are a number of
elements in tables that can actually be used outside of a table, such
as LABEL, because the Document Type Definition (DTD) for HTML does not
prevent it, but the specifications for HTML, which contain restrictions
in addtion to the DTD allow their use for tables only.

Experiment with Jukka's ideas using CSS etc. using the CSS float
property, or the TABLE ALIGN attribute.

An image in a one cell table might work, using a table CAPTION. In HTML
4.01 Transitional which you are using, CAPTION has alignment options of
TOP, BOTTOM, LEFT, and RIGHT. The rendering of CAPTION itself has often
been quirky, for example, Opera 7 seems to have a bug related to
positioning the CAPTION at the bottom - it appears after a substantial
gap at the bottom of the table. If a browser does not support CAPTION,
CAPTION text will be rendered at the top of the table. Internet Explorer
6 renders caption OK, but in bold text, so CSS would be needed to make
it non bold. The default rendering in Internet Explorer seems to me to
be the best default solution of the various browsers.

Alternately a two cell table with the picture caption in a TH cell at
the bottom, might do, and hopefully non visual users will be able to
figure it out.

By the way, the LONGDESC attribute is for a URL that goes to a secondary
web page bearing the long description of an image, not for the
description itself. I made this mistake the first time I did it too, so
don't feel bad about it.

Please note that a large number of accessibility problems have arisen
from just this situation: a designer wants a page in HTML to look
exactly like a page in some other medium, such as print. HTML was not
designed to be a page layout medium, and if accessibility is a concern,
one needs to be adaptable enough that having a page look some other way
is acceptable. If we look at the most recent HTML specfications, we find
layout/formatting elements that have snuck into HTML in the past being
removed. The layout options are part of the CSS specifications, and one
should always try to find a CSS solution first, even at the expense of
having to exclude format for some older browsers, such as the horrible
Netscape 4.

Terence de Giere

To subscribe, unsubscribe, or view list archives,
visit http://www.webaim.org/discussion/