• Want to receive the latest contracting news and advice straight to your inbox? Sign up to the ContractorUK newsletter here. Every sign up will also be entered into a draw to WIN £100 Amazon vouchers!

HTML alt text

xoggoth

More fingers than teeth
Joined
Jul 8, 2005
Messages
17,144
Likes received
4,956
Thanks received
1,186
Location
xoggoth towers
Can find nowt on net but maybe soemone knows different. Is there any way to enlarge the text specified in the alt tag for an image???

Ta for any answers.
 
No - you'll need to use one of the many JavaScript 'tooltip' scripts available to get the effect you require.
 
Oh well, it is an interactive in jscript so adding another popup box will be trivial anyway. Cheers!
 
Can find nowt on net but maybe soemone knows different. Is there any way to enlarge the text specified in the alt tag for an image???

Ta for any answers.

As other have said, JS is the only way to do large-text tooltips. Use a library like JQuery or YUI to save yourself too much mucking about and get out-of-the-box cross-browser compatibility.

BTW, the "alt" text is only displayed by IE, and IE is wrong to do so - you should be using the "title" attribute if you want tooltips to appear. The "alt" attribute is only supposed to be shown as a placeholder if the image can't be displayed, or to be (e.g.) read out by assistive technologies such as screen readers used by visually impaired users, whereas the "title" attribute is specifically for the purpose of being displayed in addition to the image (via a tooltip, for example).

So if you have any situation that relies on a tooltip appearing, use "title" for it or it won't work in Firefox, Opera, Safari, Konqueror, or indeed any other proper browser, as opposed to the appalling heap of bug-ridden rubbish that Microsoft have been forcing on the world.

Note that IE will (correctly, and in the same way as all other browsers) show the "title" in preference to the "alt" text, if both are present. This means that you can have a short tooltip using "title", while using alt for slightly longer text that would be too much for a tooltip, but is of greater help to assistive technology users; e.g.

<img src="banana.gif" title="Banana" alt="An anthropomorphised banana dancing from side to side with a gleeful expression on its face">

will show "Banana" in the tooltip, but a blind user would get a useful description of what they couldn't see.
 
As other have said, JS is the only way to do large-text tooltips. Use a library like JQuery or YUI to save yourself too much mucking about and get out-of-the-box cross-browser compatibility.

BTW, the "alt" text is only displayed by IE, and IE is wrong to do so - you should be using the "title" attribute if you want tooltips to appear. The "alt" attribute is only supposed to be shown as a placeholder if the image can't be displayed, or to be (e.g.) read out by assistive technologies such as screen readers used by visually impaired users, whereas the "title" attribute is specifically for the purpose of being displayed in addition to the image (via a tooltip, for example).

So if you have any situation that relies on a tooltip appearing, use "title" for it or it won't work in Firefox, Opera, Safari, Konqueror, or indeed any other proper browser, as opposed to the appalling heap of bug-ridden rubbish that Microsoft have been forcing on the world.

Note that IE will (correctly, and in the same way as all other browsers) show the "title" in preference to the "alt" text, if both are present. This means that you can have a short tooltip using "title", while using alt for slightly longer text that would be too much for a tooltip, but is of greater help to assistive technology users; e.g.

<img src="banana.gif" title="Banana" alt="An anthropomorphised banana dancing from side to side with a gleeful expression on its face">

will show "Banana" in the tooltip, but a blind user would get a useful description of what they couldn't see.



:spel
Because IE is intelegent enough to detect that you have omitted the title, so will display the alt text as a title as this may be some use to the user.


HTH
 
Last edited: 20:15
:spel
Because IE is intelegent enough to detect that you have omitted the title, so will display the alt text as a title as this may be some use to the user.


HTH

:spel
Because the IE team didn't follow the specifications, produced a buggy implementation, and have ever since refused to correct it because some people who don't know anything about HTML have come to rely on it.

HTH



(Oh, and :spel intelligent :D)
 
How is it a bug?


You said yourself that if the title tag is there, IE displays it.


EDIT:

Just read the link you posted and nowhere in the specification for alt text does is say that the alt text attribute should not be used as a title if the title is not present.
 
Last edited: 21:12
The point is that Alt is designed to display some text to the user when they cannot load the picture. You may not want to set a tool tip, but IE forces you to have one anyway.

IE is a pain in the arse bug ridden POS, IE6's amazing rendering of some CSS stuff also leaves a lot to be desired.
 
The point is that Alt is designed to display some text to the user when they cannot load the picture. You may not want to set a tool tip, but IE forces you to have one anyway.

IE is a pain in the arse bug ridden POS, IE6's amazing rendering of some CSS stuff also leaves a lot to be desired.

Yeah - bring back Netscape 4.x; now there was a browser that worked :rollin:
 
thx

thx

#4 NickFitz. Many thanks chappy - I'd used the alt and title attributes previously without ever realising the difference. Your post cleared it all up for me. Brilliant!
 

Advertisers

Back
Top