Forum Moderators: open
ALT="LINE ONE
line two">
Shouldn't there be a way to center the two lines correctly, so that they display one on top of the other within the tag?
Thanks for looking. :)
I'm not aware of any way of controlling the display of the text within the
alt attribute. You need to bear in mind that, in general, white space has no influence in HTML markup. It is important to note also that you should not rely on the tooltip showing the alt text - modern browsers other than Internet Explorer do not show it at all as a tooltip, and it is meant as an alternative to the image, not a complement to it.
Html tags like <br /> in alt text do not work and are displayed as is. This indicates that alt text are taken very literally by browsers. Html entities are properly translated however...
I've seen some people achieve some level of centering by just inserting spaces at the beginning of the lines they want centered:
<IMG src="image.gif" alt="This is my first line
and this is
my second line" \>
I would not bet on different browsers handling the above consistently though. I personally stick to plain single-lined alt text, no fancy.
As encyclo mentions, better consider alt as what they're meant to be: just alternate to images when they can't be displayed for some reasons, or for impaired users.
Cheers,
Cook