W3C home > Mailing lists > Public > w3c-wai-ig@w3.org > July to September 2001

RE: empty alt tags

From: Jon Hanna <jon@spinsol.com>
Date: Wed, 15 Aug 2001 20:35:44 +0100
To: <mpodd@iqnetcom.com>, <w3c-wai-ig@w3.org>
Message-ID: <NDBBLCBLIMDOPKMOPHLHGEGKDGAA.jon@spinsol.com>
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

> Hello,
> Can anyone tell me the purpose for using empty alt tags for
> unessential images like spacer gifs?
> 
> In researching accessible web design, I came across this 
> recommendation but
> could not find an explaination for it.

Firstly all HTML attributes are one of three types:
1. Those which have a default value (e.g. the default colspan value
is 1, so there is no need to type <td colspan="1">)
2. Those for which the value can be guessed from context and browser
defaults if it is absent, and
3. Those for which there is no reasonable way for the browser to
guess the correct value, and which must therefore always be given,
such as the src and alt attributes of the <img> element.

As such leaving out alt attributes isn't  just bad from the point of
view of accessibility, it isn't correct HTML.

As far as accessibility goes I've just said that HTML requires the
attribute because there is no good way of guessing it's value. When a
browser *does* come across such an image it has two choices, it can
either assume alt="" which could lead to an important (if badly
marked-up) part of the document being ignored, or it can render it as
something like [image], the filename, or a similar way of indicating
the image's presence.

The latter is what many non-graphical browsers opt for. It has
advantages in that it quickly identifies errors, and a page full of
[image][image][image] is less confusing for the user than a blank
page, as at least they can tell what went wrong.

-----BEGIN PGP SIGNATURE-----
Version: PGPfreeware 6.5.3 for non-commercial use <http://www.pgp.com>

iQA/AwUBO3rPEIFpv9f1Mr0YEQJ3pwCfcZWohBdzPnaPsc/ZcnPO5jjMW2AAoLH1
ya0ejVsdDfXjKy3iS0bRhkGM
=1ueq
-----END PGP SIGNATURE-----
Received on Wednesday, 15 August 2001 15:34:45 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 19 July 2011 18:13:55 GMT