Do you mean when the image is not there or on mouse over the image? I believe you have to use title="" to get text on mouse over in FF, but I could be wrong.
|What could be the reason for FF not showing my img alt text? |
If you are looking for the alt attribute to popup when you hover your cursor over the image, that won't happen. And, that is the intended behavior. IE has had it wrong all these years. ;)
I believe the only browser that shows the alt attribute on cursor hover is IE.
Hi henry. guess what IE has it wrong (the shock).
Alt attributes were not really supposed to be assigned a tool-tip behaviour (as per w3c standards). They incorrectly implemented it - as Marshall says the title attribute is the correct way to do it.
In light of that Firefox and other compliant browsers will no show this for alt text, but will for title.
added - gosh aren't we all keen this afternoon :)
So many answers in such a short time; I am impressed :)
Ho Surprise! Guess I do not deal too much with pure HTML
So the FF correct way will be to deliver alt via CSS tooltip
.. . pass the potato to the CSS "CSSer"
added Limbo I suppose we are not on the part of the world, it's AM to me!
I think the "correct" way is still to use the title attribute in the img tag. You can use css but the amount of coding involved seems a bit OTT.
Title attribute gives a tooltip in IE and FF. In another thread recently, Tedster (I think) said that he had never seen the title attribute's text get indexed by an SE, which is good news, since in most cases I simply duplicate the title and the alt text. If you're generating links programmatically (i.e. pulling alt text from a DB), it's easy to add
to every img tag and you're done!
IE will display the <title=> attribute text on mouseover if it is present. If not, it will display the <alt=> attribute text.
Remember, though, that <alt=> attribute is supposed to be a description of the image for cases when the image does not exist (404 or 410), or when it isn't loaded due to user-preferences or network problems, while the <title=> attribute is less-strictly defined as "a title for the object".
So putting the same text in both attributes is usually not the right approach. An example more in line with the original intent would be:
<img src="venice-canal-photo1.jpg" alt="Photo of Venice canal tour boats" title="Tour the Venice canals with Best Boat Tours!">The <alt=> text shows if the image isn't displayed and gets read by screen-readers for the visually-impaired, and the <title=> shows as a tool-tip on hover.
Well, most often that's the same for me. A typical usage would be a picture of a flower and the tage might be
<img src="flower-name.jpg" alt="Flower name" title="Flower name">
The alt tells the screen reader what the subject is. The title identifies the subject of the picture, which presumably the person can see, but perhaps not identify (though there's generally an additional caption, I use the title mostly in cases where there is not).
I would however agree that "logo for My Site" or "buy button" might be acceptable alt text but certainly not title text.
IMO, Firefox NOT displaying the ALT on mouseover is a significant negative using Firefox and one reason I will stay with IE7.
I use mouseover when surfing and also believe it helps my websites search indexing and adds to my keyword values from SEO work.
Also, with many forums (but not this one) the alt text displays and reads the first few lines of the posts so if it is not interesting there is no need to view the post and thread. Not sure if this is the same process as using the Alt Tag or not but seems to be related. It's a very nice often used feature of forum boards that have it implemented. It would be good if that worked here too.
IE implemented <alt=> incorrectly in early versions, and then added <title=> support later. So don't blame the W3C-compliant browsers that do things correctly.
The two attributes are not intended to be used as mutually-exclusive options or to be used redundantly; They have different purposes.
<alt=> text is for the blind using screen-readers and for others with image display disabled; It provides alternate text for when the image is not loaded or cannot be seen.
<title=> is for title-finders and for "pop-up caption" mouse-over effects.
Follow that, and your site will work well with IE and with standards-compliant browsers.
Thanks jd for your ongoing assistance.
I implemented the code a few min ago based on your earlier post:
<img src="http://example.org/images/charcot-foot.gif" width="100" height="65" border="0" alt="Photo of serious case of charcotfoot" title="Learn about charcot foot, cause, symptoms & treatment from our example.org web-site!"> but during mouseover hover only the title tag is displayed and not the alt tag as expected. Is that correct? Also, is the way the 2 tags are worded acceptable?
As described above, displaying the title attribute on hover is the correct behaviour. If you wish to see the alt-text, disable image display in your browser, or use a screen-reader for the blind.
Sorry Jim, I missed reading the post where you had already said that. Thanks again.
BTW, I realize SEO work and SE ranking is not the intent of the 2 tags but still have to wonder anyway if you think using BOTH an alt and title tag will help as far as SEO work and keyword indexing goes? Of course that would be a nice bonus to using both tags.
The text in an alt attribute's value is definitely used when the image is linked - and used to a lesser degree when the image is not linked.
Google engineers confirmed to me, back in 2005, that they were not using title attributes in their algorithm at that time because they were too uncommon on web pages. Title attributes still do not appear to be used in any fashion - I gave up testing this about 6 months ago, after several years of hoping.
Thanks Tedster. I always assumed the alt tag gets indexed.
I will test it myself by putting some unique text in both the img alt and img title tags and then check back later to see if they are both indexed.