Log in

View Full Version : background image problem - want to use alt tag, plz help



anoop
11-24-2006, 07:41 AM
If I am using this coding than I am getting image in my page.

a.red {
background-image:url(images/red_arrow.gif);
}


If I use this coding than result is same, but I want alt tag in that Image.

a.red {
background-image:url(images/red_arrow.gif);
background-image[alt]:Vote Down ;
}


How can I use alt tag in image calling by Css file.


plz help me

codeexploiter
11-24-2006, 08:21 AM
Just check this one (http://www.w3.org/TR/CSS-access) out

anoop
11-24-2006, 08:29 AM
thanks, I am in http://www.w3.org/TR/CSS-access page, now finding the solution

mwinter
11-25-2006, 11:50 AM
How can I use alt tag in image calling by Css file.

You cannot. You need to include the image via markup, not CSS.

Background images should be used for decoration, only. If an image is (or has) content, then use an img element.

Mike

coothead
11-25-2006, 12:04 PM
Hi there anoop

if you wish to supply a little 'info' to an anchor element, then use the title attribute...


<a class="red" href="#" title="Vote Down">.....

coothead