[thelist] Re: Accessibility and alt text - quality vs quantity

Toby Mills toby at tobymills.com
Wed Jan 28 10:57:37 CST 2004

It probably a bit late to say/ask this now, but why are people still using
spacer images?
The reason I ask is because any one designing for IE5 and later should
really be using CSS with paddings and margins. And images used only for
styling and not to convey any content, place them as background images (see
below) which alleviates the problem of alt and title tags.

<POSSIBLEtip author="Toby Mills" subject="using CSS to easily place styling
If you wish to place images on a web page for styling or background purposes
then I suggest the following method.
Create a CSS Class with the image set as the background, and margins set as
the height and width.
<style type="text/css">
.nicePicture {background-image:url('./nice.jpg'); background-repeat:
no-repeat; }
div.nicePicture{ width:288px; height:361px; border:1pt solid red;}
div.PicWithTxt{padding-left:288px; height:361px;border:1pt solid red; } 

Then to use it on the page simply add the following code where you want it:
<div class='nicePicture'>&nbsp;</div>

N.B. This will on work for browsers that support CSS Style sheets, e.g. IE5
or later 

See http://fukc.homeip.net/examples/CSSBackgroundExample.html for code.



toby mills
web developer & programmer



-----Original Message-----
From: thelist-bounces at lists.evolt.org
[mailto:thelist-bounces at lists.evolt.org] On Behalf Of James Aylard
Sent: 28 January 2004 15:54
To: thelist at lists.evolt.org
Subject: Re: [thelist] Re: Accessibility and alt text - quality vs quantity

Toby Mills wrote:

> For my 2 pennies worth, I think that images that convey little or no
> information and who's sole purpose is to provide page formatting only
> need to be given alt=" ". They are a spacer therefore their
> description is a space.

    I was hoping that the single-space alternative wouldn't come up, and was
pleased that it hadn't so far. There is absolutely _no_ reason to provide a
space as alt text; although most screen readers likely won't audibly render
it for sightless visitors, for the vast majority of the browser-wielding
world (those who use some flavor of Internet Explorer), that empty space
renders visibly as a small, annoying, blank tooltip. Sure, you _could_ add
an empty title attribute to counter it, but the foolishness of that is, I
think, self-evident. And by using a space, you're adding another unnecessary
byte to your page weight, which is a step backwards for usability.
    If you have an image for which alternative text would be superfluous,
only ever always use an empty string, as in alt="".

> Annoyingly W3C states spacers should have alt's but does not say what
> they should be.

    That depends on where you look. Quoting directly from the HTML 4.01

"Do not specify irrelevant alternate text when including images intended to
format a page, for instance, alt="red ball" would be inappropriate for an
image that adds a red ball for decorating a heading or paragraph. In such
cases, the alternate text should be the empty string ("")." [1]

    Granted, if I choose to, I can read your single-space suggestion as
simply mischievous criticism of the use of spacer gifs. But if that is what
you intended, it is too subtle for the green among us who may not be aware
of the arguments against it.

1. http://www.w3.org/TR/1999/REC-html401-19991224/struct/objects.html#h-13.8

James Aylard

* * Please support the community that supports you.  * *

For unsubscribe and other options, including the Tip Harvester 
and archives of thelist go to: http://lists.evolt.org 
Workers of the Web, evolt ! 

More information about the thelist mailing list