Click to See Complete Forum and Search --> : Format ALT


Dysan
01-17-2008, 04:33 PM
Hi,

Using CSS, is it possible to change the color of the text contained inside the ALT section of an image?

<img alt="ALT Message" src="someimage.jpg" />

sneakyimp
01-17-2008, 05:48 PM
I don't think so.

dougal85
01-17-2008, 05:51 PM
No you can't - this is controlled by the browser/OS.

You would need to make a custom one via JavaScript.

Dysan
01-17-2008, 06:00 PM
Can the TITLE attribute be formatted using CSS?

sneakyimp
01-17-2008, 06:02 PM
The ALT tag should not be used for popup text if that's what you're after. the Title attribute is the correct attribute to use for a tooltip.

As for the alt tag, it is used when a referenced image is missing (in firefox anyway) or when the user's browser does not handle images.

bpat1434
01-17-2008, 06:17 PM
You can simulate the "title" attribute and use some Javascript with CSS to create a styled pop-up.

Example & Tutorial (http://fijiwebdesign.com/2007/content/view/82/77/)
Bubble Tooltips (http://trentrichardson.com/examples/csstooltips/)

So it's possible to do both with and without javascript.

sneakyimp
01-17-2008, 08:08 PM
Yeah do a google search for 'Javascript tooltip'