views:

19

answers:

1

If the element is not rendered successfully, the text equivalent will be displayed.

For the <img> tags, we could use ALT attributes to represent the text equivalents. But things get complicated when the image is rendered as <span> + background-image css property. Since ALT attribute is only meaningful for <img>, it couldn't be used here.

What should I do to create text equivalent for them?

+1  A: 

You can use the title attribute.

See this and this for details.

<span title="my text" class="anImageClass"></span>
Oded
They are different: TITLE is for the tooltip and ALT is for the alternate text when the element cannot be rendered normally.
Chris
@Chris - very right. But `ALT` only exists on _images_. You should only use CSS images if they are _decorative_, not if they are to be a functional part of the page. http://www.accessifyforum.com/viewtopic.php?p=14211
Oded
@Oded Thanks for the info. I think it's impossible to solve my problem unless the page design is changed. Could you edit the answer above so that I can accept it?
Chris