mozilla firefox - image alternative text

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
ddragas
Forum Contributor
Posts: 445
Joined: Sun Apr 18, 2004 4:01 pm

mozilla firefox - image alternative text

Post by ddragas »

How to make up mozilla firefox browser to show up alternative text while mouse over image like IE does?
User avatar
onion2k
Jedi Mod
Posts: 5263
Joined: Tue Dec 21, 2004 5:03 pm
Location: usrlab.com

Post by onion2k »

By putting the text in the title attribute as the HTML spec tells you to. Alt text is only for when the browser is unable to display the image, title text is for the tooltip.

Code: Select all

<img src=&quote;image.gif&quote; title=&quote;An image&quote; alt=&quote;Display me if image.gif is missing&quote;>
User avatar
ddragas
Forum Contributor
Posts: 445
Joined: Sun Apr 18, 2004 4:01 pm

Post by ddragas »

Thank you for reply, but I don't think you've understood my question. I know what for is alt text, and i know how to write html code for it. Question was how to "pop-up" this alt text in mozilla like Internet explorers does?
Roja
Tutorials Group
Posts: 2692
Joined: Sun Jan 04, 2004 10:30 pm

Post by Roja »

ddragas wrote:how do you "pop-up" this alt text in mozilla like Internet explorers does?
onion2k wrote:By putting the text in the title attribute as the HTML spec tells you to
Try *reading*.

Use the title attribute.
User avatar
ddragas
Forum Contributor
Posts: 445
Joined: Sun Apr 18, 2004 4:01 pm

Post by ddragas »

Sorry - my mistake

:oops:
rashedkarim
Forum Newbie
Posts: 2
Joined: Thu Jun 02, 2005 5:26 pm

Post by rashedkarim »

Hi there,

You can do this using the title attribute of the <img> tag. Try this:

Code: Select all

<img title="this is an image" src="/myImagePath.jpg" />

Code: Select all

Now, when the mouse hovers over the image, 'this is an image' will show as a tooltip.
Post Reply