|
Posted by Toby A Inkster on 03/04/07 18:01
Eric Layman wrote:
> An image allows alt attribute. When mouse over images with alt attribute, a
> small yellow popup would appear besides the mouse cursor.
This is an MSIE-only "feature". The alt attribute is supposed to only be
displayed when the image cannot be displayed.
The correct attribute to use for such tooltips is title. Although title
doesn't *have* to be displayed as a tooltip, in practise, all current
mainstream browsers do -- including MSIE. (When both title and alt are
available, MSIE will show the title, not the alt!) Whatsmore, the title
attribute is available for pretty much every element -- not just images.
Examples:
<img src="/path/to/image.png"
alt="Text for when image is unavailable"
title="Tooltip text">
<a href="http://www.google.co.uk"
title="The Google Search Engine">Google</a>
<table title="Sales Figures for January 2007"
summary="Sales have increased ten-fold. Hurrah!">
<caption>Jan 2007</caption>
<!-- DATA GOES HERE -->
</table>
--
Toby A Inkster BSc (Hons) ARCS
Contact Me ~ http://tobyinkster.co.uk/contact
Geek of ~ HTML/SQL/Perl/PHP/Python*/Apache/Linux
* = I'm getting there!
[Back to original message]
|