Firefox, ALT Tags, and Tooltips

Nov 9

Firefox, ALT Tags, and Tooltips

Extension Room :: Popup ALT Attributes: Interesting little flamewar going on over at the Mozilla Extension Room. First, here’s something I didn’t know:

The ALT tag for images is NOT supposed to produce a little tooltip when you mouseover an image, according to the HTML spec. This is supposed to be the job of the TITLE tag.

Firefox has never done this for ALT tags, correctly obeying the spec. This always confused me, because some images would pop a tooltip and others wouldn’t. Apparently the ones that did also had a TITLE tag, unbeknowst to me.

However, IE has always done it for the ALT tag too, which actually seems reasonable to me. I don’t see the harm.

So someone created an extention for Firefox to “fix” this problem. Not everyone was pleased:

It’s a shame people are producing extensions like this. ALT is the text that is to replace the image if for whatever reason the image doesn’t load. The tooltip text is supposed to be the value of the TITLE attribute.

Flaming ensued:

It’s a shame people are #*X?@ing about the availability of plugins that allow me to view pages in the way I see fit. It’s not as if the mozilla team is forcing you to view pages a certain way and I’ll be damned if I can’t view pages the way I want, regardless of how you code them. If you are blind, can not load images or are saddened by the weakening of the w3c’s role in developing web standards then do not download this plugin.

Comments

by Phil,   November 18, 2004 12:32 PM  

I don't know. I don't think emulating bad behavior is good just because it's what people are used to...


by Phil,   November 18, 2004 12:39 PM  

In fact, thinking a bit further into the subject, it's entirely possible that things like this are actually pretty dangerous.

This plugin appeals to a certian small subset of the internet at large, a good portion of which are developers. So, instead of using this to say "Hey guys, just start using TITLE tags like you're supposed to. It's no big deal.", we say "Let's just make it so we don't have to do anything different at all." I think this is a very small representation of the very large issues that keep web standards from being the norm.


by gioppe,   November 18, 2004 12:56 PM  

I think freedom and flexibility are one of Firefox's strenghts. Default behavior should stick to W3C standard, then you have the choice to play around with extensions, alternative stylesheet, XUL, whatever.


by Dave,   November 18, 2004 1:11 PM  

"Apparently the ones that did also had a TITLE tag, unbeknowst to me."

Not necessarily "also"; the TITLE attribute is not dependant on the ALT attribute.


by ned,   November 18, 2004 1:46 PM  

but alt tags are required to be xhtml compliant. i think emulating this behavior is a bad idea. i like to use the alt ant title tags for different things. the alt is really to describe the picture in case it doesn't load or a text-based browser or screen reader is being used. titles are great for little extras like instructions, fun facts, and the like that show up only if the user cares enough to mouse over the image. this modified behavior means that everything you put into your title tags isn't displayed. it's like deciding not to display p tags because spans can do a lot of the same stuff.


by Mark,   November 18, 2004 3:06 PM  

I am sighted, can load images, and don't give a s#@! about the W3C's role in anything, but I do know something about the history of ALT and TITLE attributes. Netscape 4 got it wrong, using the ALT attribute as a tooltip. IE emulated that behavior. Then people complained that that was wrong (true), and Microsoft listened (amazing but true), and IE was changed to use the TITLE attribute as the tooltip. However, if no TITLE attribute is present, then it will still use the ALT attribute as a tooltip, to emulate Netscape 4's behavior.


by Alex Stapleton,   November 19, 2004 4:14 AM  

Why exactly is this bad practice anyway? Just because the spec says it doesn't mean its the most logical, or the optimum. I mean if you think about it, this sort of alteration actually adds useful functionality to your browser.

1) If people wan't tool tips which read the same as the ALT text, they dont have to write both in. Which is good for two reasons. Firstly, lazy developers have to type less, and secondly it means you have to download less redundant data which means smaller pages which means faster load times.

2) If people wan't a seperate Tooltip which is different from the ALT text, they can define the TITLE attribute anyway. It's not like the ALT tag has to or should override the TITLE tag.

Wheres the bad side? So what if it means people can be a little bit lazier? (which it doesn't. because its an extension. If you want cross-browser support properly your going to have to define both anyway) I honestly can't see any logical reason to dislike this plugin. The only people whining about this is those who are subjucated to the W3C and can't manage to think for themselves. "It's what the specs say" is not a reason.


by macewan,   November 19, 2004 6:55 AM  

specs should be followed and work towards changing the spec

incorrect is incorrect - do we emulate bad specs from opera just because we think they do it right as opposed to those that write the specs?


by Chess,   November 19, 2004 7:19 AM  

The long and short of it is that Firefox isn't emulating IE here. An extension is. Don't like it? Don't use the extension. Personally, I'd use it. I also wish there was an extension that would render customized scroll bars like IE can.


by Shawn,   November 22, 2004 4:21 PM  

Alex, ALT text was never intended to be seen and the ALT and TITLE content should be different. The spec is quite clear and, IMHO, correct about this. The most pratical example I can think of would be an icon in a web application.

The Image's ALT: Iconographic white document with text

The link surrounding the icon might have a TITLE of: Edit this document's title, body, and summary.

Similarly, you may want to give a photo in a news article a lengthy ALT describing the location, time, and people involved - but place the copyright info in the TITLE (though it would be more appropriate in a cite tag... but ehh... big media companies and their CMSes)

That said, if someone wants to implement a Firefox plugin to make all strong tags blink repeatedly ... I mean, that's their choice.


by Henri Sivonen,   November 23, 2004 2:41 AM  

It's in the FAQ... http://www.mozilla.org/docs/web-developer/faq.html#alttooltip


by Brendan Taylor,   November 23, 2004 1:07 PM  

"The most pratical example I can think of would be an icon in a web application.

The Image's ALT: Iconographic white document with text" This would be incorrect usage of the alt attribute as well. If for whatever reason I can't see your image (I'm blind, I'm using lynx, I'd rather have my phone read the page to me than squint at the tiny screen, ...) having "Iconographic white document with text" in its place is completely useless to me. A better value for alt would be "Edit" or "Edit this document".

"Similarly, you may want to give a photo in a news article a lengthy ALT describing the location, time, and people involved"

An image that is itself a piece of content is a less clear-cut case. IMO alt's purpose is better served with a summation of the information conveyed by the photo than a description of the scene; for example, with a vacation photo "Leif, Monica and I had lots of fun boating in the Okanagan" is preferable to "Leif, Monica and I in a houseboat on a calm lake with lots of maple trees behind us".

longdesc="" is for descriptions, alt="" is for text that conveys the same meaning as an image.


by Tremendo,   November 23, 2004 1:20 PM  

Cool to keep the core as pure as possible, to handle alt and title attributes as the spec dictates. But, hands-off my extensions! these can be freely created by third parties to satisfy whatever needs or wants they have, and sorry, but those are out of anyone's control. Now, do you want to see a flame war between browser so-called 'purists' and other er, shall we call them 'progressives'? Why doesn't Moz/Gecko/Firefox support picture fonts (Webdings, etc)?


by Lachlan Hunt,   November 23, 2004 8:21 PM  

In general, I agree with those that believe the alt text should not display as a tooltip, and I appreciate the fact the the Mozilla team will not violate the specifaction to introduce such a harmful feature. http://www.hixie.ch/advocacy/alt-tooltips

However, I also accept that people have a right to customise Firefox however they see fit, for their own use. So, the availability of an extension that provides the behaviour for those that want it is not a problem, and I think those that participate the flame war need to stop and think about the situation a little more.

Although, I will never use the extension, nor recommend its use to anyone, it is their choice, and if they want Firefox to mimic the harmful behaviour of IE and NN4, then so be it.


by Gordon,   November 24, 2004 5:20 AM  

Ohh go on then I'll chip in.

As long as the core browser follows the specs I'm a happy bunny. If developers choose to ignore those specs then on their head be it.

If, as a web user, I want to use this extension I should have the choice to do just that.

Spotted what's missing yet?

Education.

I didn't know that about ALT and TITLE tags either and it sounds like a lot of developers don't (or they'd use them correctly, right?). Maybe the author of this extension should expand on this a little in the description. That way people how decide to use it will at least KNOW that the sites they are viewing that use ALT instead of TITLE are not coded to the W3 spec.

I think this is less about the extension than the understanding of WHY the W3 spec should be followed. Alex said "Just because the spec says it doesn't mean its the most logical, or the optimum. " And I agree. HOWEVER if that is true then YOU SHOULD BE WORKING TO CHANGE THE SPEC!! Not ignoring it.


by MikeyC,   December 18, 2004 12:14 PM  

"The ALT tag for images is NOT supposed to produce a little tooltip when you mouseover an image, according to the HTML spec. "

The HTML spec does not say that a visual UserAgent cannot display ALT text as a tooltip. The reason why Mozilla does not display ALT text as a tooltip is not because doing so would violate the spec, but because designers tend to abuse the ALT attribute by expecting a tooltip to be displayed when they should be using the TITLE attribute instead. Mozilla is simply trying to discourage this practice.

Here it is in their words:

"Mozilla doesn’t display the alt attribute as a tooltip, because it has been observed that doing so encourages authors to misuse the attribute." -- Source: http://www.mozilla.org/docs/web-developer/faq.html#alttooltip

People who are outraged by this Firefox extension or Internet Explorer's behaviour in this regard really don't know what they are talking about. A UserAgent can choose to expose any part of a hypertext document to a user in any way it chooses. This does not violate the HTML spec, because the HTML spec doesn't govern such issues.

The real issue here is web developers who abuse the ALT attribute, not with the way in which a browser chooses to expose hypertext information to a user.


by Deane,   December 18, 2004 8:15 PM  

I read a trackback the other day for this post that pointed out something about the title: it's not an "ALT tag" as I say. It's an attribute, not a tag. I don't know what I was thinking there.


by ,   January 1, 2005 3:02 AM  

its a pain in the ass....so many different renderings of data in different browsers..makes life very hard for us web designers.


by ,   January 9, 2005 4:11 AM  

"Just because the spec says it doesn't mean its the most logical, or the optimum. " And I agree. HOWEVER if that is true then YOU SHOULD BE WORKING TO CHANGE THE SPEC!! Not ignoring it."

If the entire history of graphical browsers teaches us one lesson, it's this: ignoring the spec is the most effective way of changing it.


by dag,   January 14, 2005 4:51 PM  

specs are set for a reason. There are reasons why there is a market for new browser (firefox) that follows the W3 specs closer. Not that i'm surprised that micro$oft got another product wrong. :P


  • There are 78 comments on this entry.
  • 20 comments have been displayed above.
Load the next 20 comments.

Comments are Closed

Thanks to all who participated.

Want to advertise on this site? Contact FM.