W3C home > Mailing lists > Public > www-html@w3.org > August 2005

The ALT attribute and its semantics

From: Jukka K. Korpela <jkorpela@cs.tut.fi>
Date: Thu, 18 Aug 2005 08:27:13 +0300 (EEST)
To: www-html@w3.org
Message-ID: <Pine.GSO.4.63.0508180811480.29462@korppi.cs.tut.fi>

On Wed, 17 Aug 2005, David Woolley wrote:

>>        <img src="enter.gif">
> As well as being off topic, that's not valid HTML!

Well, practical "how do I..." questions are off-topic here, but the markup 
above _is_ valid - when using an HTML 2.0 document type. Although it was 
questionable to make the ALT attribute optional, and although this was 
fixed in subsequent HTML specifications, the HTML 2.0 specification was 
here, as usual, a big improvement over its successors in clarity
of semantic definitions:

"HTML user agents may process the value of the ALT attribute as an 
alternative to processing the image resource indicated by the SRC 


   text to use in place of the referenced image resource, for example due
   to processing constraints or user preference."

Compare this with the awful "short description" characterizations in HTML 
4.01 specification or with its definition
"For user agents that cannot display images, forms, or applets, this 
attribute specifies alternate text."
followed by prose that talks of many things, including browsers that _can_ 
display images...

The morale is, I think, that the specification of a markup language should 
clearly distinguish normative semantic definitions and requirements from 
explanatory prose (and both of them from syntactic requirements). 
Naturally, the explanatory text should be reasonably consistent with the 
normative text, since people often confuse the two anyway.

Jukka "Yucca" Korpela, http://www.cs.tut.fi/~jkorpela/
Received on Thursday, 18 August 2005 05:27:28 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 15:06:11 UTC