W3C home > Mailing lists > Public > wai-wcag-editor@w3.org > October to December 2001

Space in 'alt' attribute problematic w.r.t. HTML 4.01

From: Ian B. Jacobs <ij@w3.org>
Date: Wed, 26 Dec 2001 11:37:54 -0500
Message-ID: <3C29FCE2.85EA54EB@w3.org>
To: wai-wcag-editor@w3.org

Vincent Lefèvre sent an email to me earlier this year
explaining a problem with one of the WCAG 1.0 Techniques
for HTML suggestions. From section 6.1.1 [1]:

  "Or, if you provide link text, use a space as the 
  "alt" attribute value of the IMG element. Note that 
  this text will appear on the page next to the image."

However, in the HTML 4.01 DTD, for the IMG element, we have:

  %attrs;                              -- %coreattrs, %i18n, %events --
  src         %URI;          #REQUIRED -- URI of image to embed --
  alt         %Text;         #REQUIRED -- short description --

where %Text; is CDATA. HTML 4.01 says about CDATA [2] that:

  User agents may ignore leading and trailing white space in CDATA
  attribute values (e.g., "  myval  " may be interpreted as "myval").
  Authors should not declare attribute values with leading or trailing
  white space.


    Is a single space considered leading space? Perhaps not.
    I guess that we would have to see the definition in SGML.
    It can't be suppressed without changing the meaning of the
    attribute value, so it may not be considered leading.
 - Ian

[1] http://www.w3.org/TR/WCAG10-HTML-TECHS/#link-text
[2] http://www.w3.org/TR/html401/types.html#type-cdata
Ian Jacobs (ij@w3.org)   http://www.w3.org/People/Jacobs
Tel:                     +1 718 260-9447
Received on Wednesday, 26 December 2001 11:37:54 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 20:17:05 UTC