| images alt, images, css |
esha734

msg:1582866 | 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. es
|
4hero

msg:1582867 | 11:38 am on May 23, 2006 (gmt 0) | Hi, 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.
|
Don_Hoagie

msg:1582868 | 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.
|
|
|