WebAIM - Web Accessibility In Mind

E-mail List Archives

alt attribute length - was: WCAG

for

From: Christophe Strobbe
Date: Mar 3, 2010 6:09AM


At 00:15 3/03/2010, Hoffman, Allen wrote:
>It would be in the HTML specification.
>Would be a good test for an HTML validate.

I don't think so.
HTML 4 and XHTML 1.0 use SGML DTDs, which have no mechanism for
specifying maximum lengths in attributes (except by limiting the
attribute values to a specific set, which would not make sense for
the alt attribute). The data type for the alt attribute is CDATA,
which is explained at <http://www.w3.org/TR/html401/types.html#type-cdata>;.

W3C XML Schemas allow length restrictions on attributes, but the XML
Schema for XHTML does not define such a restriction for the alt
attribute (presumably for compatibility with the DTD); see
<http://www.w3.org/2004/07/xhtml/xhtml1-strict.xsd>; (search for 'name="alt"').


>Its not a WCAG specification.
>
>Make the file with alt tags of various lengths and find out what you get
>in return from the validator.
>Put a whole page inside an alt tag.

I think you will be testing validator limitations instead of the HTML
or XHTML spec.

Best regards,

Christophe



>