 |
 |
"alt" text and CSS
|
 |
|
 |
|
Mac Elite
Join Date: May 2002
Status:
Offline
|
|
Does anyone know if the alternate text in html will respond to a particular CSS style?
|
|
|
| |
|
|
|
 |
|
 |
|
Grizzled Veteran
Join Date: Nov 2003
Location: Hebburn, UK
Status:
Offline
|
|
It does in Moz browsers anyway. Just give the image the style you want and if you have any associated text styles, then the alternate text is rendered like that.
To make more sense:
Code:
img {font: 12px verdana; color: blue}
...
<img src="me.gif" alt="this is 12px verdana and coloured blue">
MSIE seems to only change the colour though, and not the font or size of the text... Admittedly, I tried this for the first time about 2 mins ago and haven't tested much (just firefox 0.9 and MSIE6, because that's all I've got at work).
|
|
Just who are Britain? What do they? Who is them? And why?
Formerly Black Book
|
| |
|
|
|
 |
|
 |
|
Mac Elite
Join Date: May 2002
Status:
Offline
|
|
ahhhh .... brillant, thank you.
|
|
|
| |
|
|
|
 |
|
 |
|
Mac Elite
Join Date: Jun 2001
Location: Dundee, Scotland
Status:
Offline
|
|
But remember - it's the "title" you should be using - "alt" is for text-only/text-to-speech browsers..
|
|
|
| |
|
|
|
 |
|
 |
|
Addicted to MacNN
Join Date: Oct 2001
Location: Yokohama, Japan
Status:
Offline
|
|
Originally posted by sambeau:
But remember - it's the "title" you should be using - "alt" is for text-only/text-to-speech browsers..
Yeah, but validators only complain about the lack of alt, not title. 
|
|
|
| |
|
|
|
 |
|
 |
|
Grizzled Veteran
Join Date: Jun 2001
Location: Melbourne, Australia
Status:
Offline
|
|
Originally posted by sambeau:
But remember - it's the "title" you should be using - "alt" is for text-only/text-to-speech browsers..
...but also for 'regular' browsers to display something meaningful in the empty frame before the image is available to view. So it's a fair question.
|
|
Computer thez nohhh...
|
| |
|
|
|
 |
|
 |
|
Mac Elite
Join Date: Jun 2001
Location: Dundee, Scotland
Status:
Offline
|
|
You can (of course) use both

|
|
|
| |
|
|
|
 |
|
 |
|
Clinically Insane
Join Date: Nov 1999
Status:
Offline
|
|
Originally posted by sambeau:
But remember - it's the "title" you should be using - "alt" is for text-only/text-to-speech browsers..
Also for visual browsers that have images turned off. Or, for that matter, for dead image links.
You're right that "alt" shouldn't be used to display tooltips. However, even discounting that it has other uses where CSS can play a role. Last I checked, even in those browsers that do (incorrectly) display it as a tooltip, that tooltip doesn't respond to CSS.
|
|
You are in Soviet Russia. It is dark. Grue is likely to be eaten by YOU!
|
| |
|
|
|
 |
|
 |
|
Senior User
Join Date: Oct 2002
Location: Adelaide, South Australia
Status:
Offline
|
|
Originally posted by wataru:
Yeah, but validators only complain about the lack of alt, not title.
WThe fact that the standards require you provide an alt tag for descriptions to non-graphic/non-visual browsers has nothing to do with the title tag being for tooltip messages. The src is also required but I don't recommend you put titles in there 
|
|
|
| |
|
|
|
 |
 |
|
 |
|
|
|
|
|

|
|
 |
Forum Rules
|
 |
 |
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is Off
|
|
|
|
|
|
 |
 |
 |
 |
|
 |
|