IMG ALT Attribute with Mozilla

T

Thomas Fuchs

Hi.

I want to display a short text, when the mouse is moved over a picture
in my website. With IE ist works like this:

<img src="../../../myPic.gif" alt="This is my Pic">


but Mozilla especially Firefox does not display the ALT Text.

Is there a workaround, how to do this with Mozilla ?!?

Thank you for reading and answering :)

Thomas Fuchs
 
T

Tonnie

Thomas said:
Hi.

I want to display a short text, when the mouse is moved over a picture
in my website. With IE ist works like this:

<img src="../../../myPic.gif" alt="This is my Pic">


but Mozilla especially Firefox does not display the ALT Text.

Is there a workaround, how to do this with Mozilla ?!?

Thank you for reading and answering :)

No workaround needed, use title="".

IE incorectly shows the value in alt.



Tonnie
 
E

Els

Thomas said:
Hi.

I want to display a short text, when the mouse is moved over a picture
in my website. With IE ist works like this:

<img src="../../../myPic.gif" alt="This is my Pic">


but Mozilla especially Firefox does not display the ALT Text.

Is there a workaround, how to do this with Mozilla ?!?

Thank you for reading and answering :)

IE is doing it wrong, as the alt attribute is meant to be the
alternative when for some reason the image isn't displayed.
To get the text when hovering with the mouse, use the title attribute.
This will work in both Mozilla and IE - IE only uses the alt value if
the title attribute is missing.
 
J

Jonathan N. Little

Thomas said:
Hi.

I want to display a short text, when the mouse is moved over a picture
in my website. With IE ist works like this:

<img src="../../../myPic.gif" alt="This is my Pic">


but Mozilla especially Firefox does not display the ALT Text.

Is there a workaround, how to do this with Mozilla ?!?

Thank you for reading and answering :)

Thomas Fuchs
The little 'tooltip' text is displayed with the TITLE attribute, ALT was
really supposed to be text to to be displayed as an ALTernative when the
image was missing or for text only browsers. A workaround to support old
4x browsers is to set both

<IMG SRC="image.jpg" ALT="Some Text" TITLE="Some Text">
 
J

Jukka K. Korpela

Thomas Fuchs said:
I want to display a short text, when the mouse is moved over a
picture in my website.

Stop wanting that. If the text is relevant, include it as normal
content, e.g. as a caption below the image. If it is not, omit it.

Others have told that it's the title attribute that's supposed to tell
an "advisory title". And that's correct but less important than the
principle of not making your page a puzzle.
With IE ist works like this:

<img src="../../../myPic.gif" alt="This is my Pic">

No, IE implements the alt attribute _poorly_. But that's a different
story. And "This is my Pic" is poor both as an alt attribute and as a
title attribute. (Right, it's just an example. But why not show
a good example. Besides, people _do_ write such foolish attributes
in reality, too.)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,050
Latest member
AngelS122

Latest Threads

Top