homepage Welcome to WebmasterWorld Guest from
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Home / Forums Index / WebmasterWorld / Accessibility and Usability
Forum Library, Charter, Moderators: ergophobe

Accessibility and Usability Forum

alt, images, css

5+ Year Member

Msg#: 71 posted 6:31 am on May 23, 2006 (gmt 0)

Hello all,
In html markup one can place an image on a page by using <img src="one.gif" width="10" height="10" alt="blah,blah">

The exact same image can be placed on the same page via CSS - body {background: white url(one.gif)}.

In markup the alt attribute is used, in CSS the alt attribute cannot be used.

Should the CSS method of displaying images be used?

Thank you.



5+ Year Member

Msg#: 71 posted 11:38 am on May 23, 2006 (gmt 0)


If the image is purely for decoration, e.g. a background image, then css is best for displaying these. If the image is relevant to the page, e.g. a photo of a product, then use the <img alt="an explanation of the photo"> method.


5+ Year Member

Msg#: 71 posted 5:20 pm on May 23, 2006 (gmt 0)

Good advice by 4hero, though i worry that people are starting to use that phrase "images for decoration" the way they use "tables for tabular data"... a vague phrase that isn't always correct.

For any given image, ask yourself this:

"If someone with a screen reader (or with images disabled) came across my page, would I rather have this image be totally invisible, or still be represented by text?"

Sometimes decoration serves a function, and is worth having in the markup.

Global Options:
 top home search open messages active posts  

Home / Forums Index / WebmasterWorld / Accessibility and Usability
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved