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

Re: OT: img Element, alt Attribute

From: Lachlan Hunt <lachlan.hunt@lachy.id.au>
Date: Thu, 18 Aug 2005 15:32:13 +1000
Message-ID: <43041D5D.2010409@lachy.id.au>
To: Dustin <gohankid77@gmail.com>
CC: W3C Mailing Archives <www-html@w3.org>

Dustin wrote:
> On 8/17/05, David Woolley <david@djwhome.demon.co.uk> wrote:
>>
>>><img src="enter.gif">
>>
>>As well as being off topic, that's not valid HTML!

It's not valid HTML 4, but it's valid HTML 3.2 where alt is defined as 
#IMPLIED, not #REQUIRED.

> How is that not valid HTML?  If you mean the @alt attribute or the @longdesc 
> attribute is missing, it isn't valid due to accessibility reasons. 

The HTML 4 DTDs specify that the alt attribute is required for img 
elements (longdesc is optional) and a document that does not comply with 
the rules expressed in the DTD is not valid.

> Accessibility is mandatory in some countries, but in others, it is not.

Although omitting the alt attribute does cause accessibility problems, 
you're confusing accessibility with validity.  Validity has nothing to 
do with accessibility, and even less to do with the author's country of 
origin.

> Even if you don't have one or both of those attributes, it is still considered 
> standard-compliant code,

No, invalid code is not standards compliant.

> depending on your location in the world and your 
> personal coding preferences. If you omit them, most user-agents will not 
> stop rendering the page (and/or the image).

Now you're confusing validity with the XML concept of well-formedness. 
While an ill-formed document is not valid and XML UAs must stop 
processing upon encountering such errors, an invalid document can still 
be well-formed and a UA will not stop processing a document just because 
it is invalid.  This applies even less to HTML and SGML, for which error 
handling is not well defined at all.

> The image will still be rendered usually, regardless of whether the
> tag's contents consist of the image's  path.

User Agent behaviour also has nothing to do with validity.

-- 
Lachlan Hunt
http://lachy.id.au/
Received on Thursday, 18 August 2005 05:33:07 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 27 March 2012 18:16:04 GMT