[thelist] alt and title

James Aylard evolt at pixelwright.com
Wed Nov 6 12:53:01 CST 2002


dunstan,

> It can be a bit frustrating I know as IE displays one and MOZ displays the
> other on mouseover, but I think sticking to their proper uses will see you
> right in the long run.

    Sometimes -- it depends. If an img element has only an alt attribute and
not a title attribute, IE/Win32 will display the alt value as a tool tip;
Mozilla will display nothing. If the img element contains a title attribute,
both IE and Mozilla will display that as a tool tip. If the img element
contains both an alt attribute and a title attribute, IE/Win32 will display
the title element as a tool tip, ignoring the alt attribute.
    If a developer provides an alt attribute value (as should be done in all
cases, even if the value is an empty string), but does not want the alt text
to appear as a tool tip in IE/Win32, including a title attribute with an
empty string as a value will cause IE to produce no tool tip whatsoever.
This plays nice in Mozilla, as well, making it a good, cross-browser
workaround.

James Aylard




More information about the thelist mailing list