Floating text over photos

StokeLee

macrumors 6502
Original poster
May 30, 2005
413
0
Stoke-on-Trent. Midlands, UK
Sorry about the strange heading, im really not sure what to call it.

This is what i want to do.

Im going to change my .mac website, and use the advanced html option.

How can i display a name, or comment, if i hover my mouse over a photo.

What is the html i need to use.

Thank you

Lee
 

zosont

macrumors newbie
Aug 25, 2006
6
0
dornoforpyros said:
<img src="images/happyguy.gif" .... alt="Happy Smiling Guy">

you just need to include alt="something here" in your image tags.
This is not true, the correct attribute is title, the alt attribute is for alternative text - text meant as a possible replacement for the image to make it accessible to non-graphic browsers (which incidentally include search engines).
The fact that some (but certainly not all) browsers display alt text as a tooltip is actually an error on their part.
Code:
<img src="photo.jpg" title="tooltip text here" alt="alternative text here" />
Hope this helps
 

Mitthrawnuruodo

Moderator emeritus
Mar 10, 2004
13,797
167
Bergen, Norway
zosont said:
The fact that some (but certainly not all) browsers display alt text as a tooltip is actually an error on their part.
Code:
<img src="photo.jpg" title="tooltip text here" alt="alternative text here" />
That is right... and why I often put the same text into both the alt and the title attributes, just to be on the safe side... :)

Like this (just steaing zosont's example ;)):
PHP:
<img src="photo.jpg" title="tooltip text here" alt="tooltip text here" />
That should work also for the large, stupid majority of browser users... ;)