Alex
Alex

Reputation: 1612

Alt tags not displaying properly in IE

this is my first post so i hope i'm being clear. Basically i'm having a problem in IE where the Alt tag text will only display on the first hover. In other words, if i hover over the image i get a nice tool tip displaying the information i need, after around 10 seconds this disappears. Which is fine, but then when i go to hover back over the image...no alt text is displayed.

this is dynamically drawn in the backend (c#)

s += "<img src=\"../../images/littleinfo.gif\" alt=\"" + Line.Description + "\" class=\"blackparagraphlink\"/>";

Whats even more strange is that this is only happening with certain users (all of our clients use IE) and appears on both IE7 and 8 (but only randomly, it isn't a problem on the machine i use...but is a problem on a machine that is at the other end of the office...both using IE8). I've checked compatibility settings, and they are turned off (i have tried turning these on...but the problem still remains).

the CSS class that the image links to doesn't seem to effect this issue either. Has anyone else come across this strange problem? I've searched high and low on the web, and this is my final attempt at solving the issue.

any help is much appreciated.

Alex :)

Upvotes: 1

Views: 1733

Answers (3)

Samy Zine
Samy Zine

Reputation: 41

ie display alt on hover and title if they are no alt
firefox display only title on hover and not alt.

Upvotes: 0

harryovers
harryovers

Reputation: 3138

this link explains the alt attribute, you should use the title attribute if you want to display a tooltip.

Internet Explorer also displays the value of the alt attribute as a tooltip when mousing over the image. This is NOT the correct behavior, according to the HTML specification.

Upvotes: 1

Ariel
Ariel

Reputation: 26753

Alt attributes are not supposed to hover in the first place. They are only used if the image didn't load.

Use the title attribute instead which is designed specifically for this. Just change alt to title in your code. Then add a real alt attribute describing what the image looks like. (Whatever littleinfo.gif is.)

PS. png's are much smaller than gifs. Use png unless you need animation.

Upvotes: 6

Related Questions