views:

206

answers:

4

to any component in html when i add tool tip text by alt="my tool tip text". it works in other browsers but not in fire fox. why. is there a way to enable it in firefox

+1  A: 

Did you try title = "Your tooltip text" ??

for example -

<a href="#" title= "Some text">Link</a> 

<div title= "Some text">Div</div>
Wbdvlpr
no space after the "="
Wbdvlpr
+1  A: 

Firefox doesn't display alt attributes as tooltips - it's a design decision.

You can use the title attribute instead (or as well).

Greg
It's not actually a "design decision", it's a question of standards compliance. "alt" attributes were never intended to be used as tooltips; "title" attributes were. Even Microsoft have finally accepted that they got it wrong, and have fixed this bug in IE 8 :-)
NickFitz
I don't think the spec says you *shouldn't* display alt as a tooltip...
Greg
+1  A: 

You can use the title attribute. For more information click here. The title attribute works with all browsers. So it would be better if you go with that instead of alt.

Example:

<div id="blahblah" title='tooltip'>
Saeros
+4  A: 

alt != tooltip

Here you can see why Firefox doesn't display the tooltip. Long story short, the alt attribute does not have anything to do with tooltips. It's just gotten into fashion over time, probably due to IE.

However, there are Javascript workarounds for displaying the tooltip anyway, but I suggest you take a different approach.

JorenB