PDA

View Full Version : empty alt attributes?


coder_seth
03-17-2004, 10:44 PM
since an empty alt attribute will validate, i've begun to use them for images that are merely design elements, since i find it is unecessary to spend the time to come up with a meaningful name which would be meaningless to the user should they see it anyway. it in fact might mislead them into thinking something important is supposed to be there.

just wondering your thoughts on this...

Feyd
03-17-2004, 10:48 PM
Always place ALT tags in your images, but do not fill them with information if they are desigin elements. They should be used, primarily (if not exclusively), to offer text descriptions for accessible browsers (page readers, etc.) when the image element cannot/is not displayed as is originally intended... With that in mind, they should be short, but offer valid information as to what the image is relating to so those who are (for example) blind, can hear what that image represents.

coder_seth
03-17-2004, 11:12 PM
thanks, but i already understood their purpose and significance..

just wondered if there were any people out there that thought empty alt's were bad, and if so why.

mindlessLemming
03-18-2004, 01:08 AM
My preference is to use the background: url(...); property with empty <div>'s for non-informational images. This way, as far as screen-readers etc are concerned, there's nothing there.
If you were really aiming for maximum accessibility, all informational images would also have a link next them that points to a text version of the info. Eg: An image of a graph would have a link to a well labelled table that portrays the same data.
When that is the case. you could also, i.m.o., use empty <div>'s for those images as users would have a link to the actual information. Such a link would probably make the "alt" text and even the <img/> tag pointless.
My $0.02,
Andrew.

coder_seth
03-18-2004, 02:24 PM
interesting approach with the divs and background images. never really considered that.

Vladdy
03-18-2004, 02:28 PM
Just a basic separation of content from presentation:
if an image is part of content (and therefore obviously deserves a non-empty alt attribute), you add it using image element.
otherwise you put it in as a background of whatever element it relates to

coder_seth
03-18-2004, 04:39 PM
good point. in a way, i thought of design elements sometimes as the content though too, but i think i like this method more and will probably start adopting it more as well.

Roy Sinclair
03-18-2004, 04:48 PM
That's the method used on the csszengarden site.

brothercake
03-18-2004, 05:59 PM
Originally posted by mindlessLemming
If you were really aiming for maximum accessibility, all informational images would also have a link next them that points to a text version of the info. Eg: An image of a graph would have a link to a well labelled table that portrays the same data.
Otherwise known as the longdesc attribute (http://www.w3.org/WAI/wcag-curric/sam3-0.htm) :) You can equally use an <object> for the image, and put long-description text inside it (as the next slide describes ..)

Tails
03-19-2004, 07:06 AM
Originally posted by coder_seth
since an empty alt attribute will validate, i've begun to use them for images that are merely design elements, since i find it is unecessary to spend the time to come up with a meaningful name which would be meaningless to the user should they see it anyway. it in fact might mislead them into thinking something important is supposed to be there.

just wondering your thoughts on this...

For layout and other things, leave the alt attribute blank. If someone is using a text browser, they couldn't see the layout anyway, so it would make their experience much easier if they only saw the important alt attribute values, such as images specifically added for the content of the page and for the page's purpose. But be sure your layout will work in text browsers and doesn't rely on only images CSS is great for bridging the gap, and making a page look good in a text-only and graphical browser as shown in http://www.csszengargen.com.