Click to See Complete Forum and Search --> : Another Firefox question of mine...


ErikLindemann
04-13-2005, 06:03 PM
I'm obviously new to Firefox and I need to know how to do something...

How do I get my "alt" text for images to work with Firefox?

David Harrison
04-13-2005, 06:11 PM
Alternate text should be displayed in the event that your images are not displayed or if the user is using a non-graphical browser. The alternate text is supposed to offer a text equivalent that serves the same purpose as the image. IE takes it upon itself to also create a tooltip with the alt text in, however this behaviour is incorrect. If you wish to create a tooltip with text in then you should use the title attribute.<img src="whatever.jpg" alt="Here is some alternate text." title="Here is some text that will show up in a tooltip.">Edit: Typo.

ErikLindemann
04-14-2005, 07:30 AM
OK. Thank you very much.

phpnovice
04-14-2005, 08:29 AM
IE takes it upon itself to also create a tooltip with the alt text in, however this behaviour is incorrect.
By "incorrect" one would presume that you are trying to say that IE is doing something that is contrary to the "standards". In fact, it is not. Nowhere in the standards will you find that it is forbidden to display the alt text as the tool tip text. Per standards, IE will also display the alt text for its intended purpose. I haven't tested it, but I presume that, per standards, if title text is supplied, IE will display that as the tool tip text instead. So, in this area, IE conforms to standards -- and goes one better.

David Harrison
04-14-2005, 09:21 AM
Alternate text is only neccessary when the image is not displayed therefore displaying a tooltip with the alternate text in is not required and in fact causes confusion because people like ErikLindemann come along and ask "why doesn't my alt text show up in Firefox?" when they are in fact trying to display a tooltip which is the job of the title attribute.

phpnovice
04-14-2005, 09:32 AM
Alternate text is only neccessary when the image is not displayed ...
Are you saying that ALT text specifications are optional? ...or, are you trying to say that ALT text should only be displayed when the image is not displayed? Again, standards do not stipulate "only". You'll find that the standards actually do give browsers quite a bit of latitude.

Confusion only comes about when a person is not familiar with the standards.

ErikLindemann
04-14-2005, 03:43 PM
I didn't mean for this to become a debate... but I see what David Harrison is getting at. ALT is short for "Alternate", this text is shown on all browsers if the image cannot be loaded. Internet Explorer is not incorrect for showing ALT text as a tooltip but they are indeed doing something contrary to standards. More like being politically incorrect.

phpnovice
04-14-2005, 04:30 PM
Internet Explorer is not incorrect for showing ALT text as a tooltip but they are indeed doing something contrary to standards.
No debate required -- just a more open view of the issue. If the standards do not say "only", then there is nothing "wrong" with fulfilling what the standards require and, then, taking the extra step beyond. "Alternate" text applies just as much to a "tooltip" as it does to the absence of an image. The tooltip is an "alternate" text description of the object with which it is associated.

IMHO, all IE is doing is avoiding the following result:
<img src="proposal.jpg"
alt="Dick proposing to Jane"
title="Dick proposing to Jane">

felgall
04-14-2005, 10:58 PM
The only thing about Internet Explorer doing that is that some web page writers expect all other browsers to display the alt text as a tooltip and the standards do not require that they do. To get it working properly on all broswers you need to include both alt and title so how IE interprets it doesn't save any coding when you write it properly to work on all browsers.

phpnovice
04-14-2005, 11:10 PM
Yes, that is true. The advantage, for the IE programmer, would be in an intranet environment where everybody is using IE. But, again, this is where the only confusion is for those that are not familiar with the standards. If you know that the title attribute is intended for tooltips, then you will code a title attribute to get tooltip text. Otherwise, the fact that IE displays the ALT text for images, in the absence of TITLE text, doesn't hurt anything.

If this were the only thing that IE did above the call of duty (standards), then I would concede the point. However, IE does so many things above the call of duty that everybody should know this already and be prepared for it. You do realize, don't you, that the reason IE does so many additional things is because of the very fact that IE is just about the only browser that is used in an intranet environment. In such an environment, additional features are a huge benefit.