Gérard Talbot wrote:
Orloff wrote : Hi,
on most (all?) browsers, when you put the pointer on a
<a href="..." title="popup text">this is a link</a>
without clicking on the link, there is a popup caption with the "popup
text".
Such popup caption purpose was specifically defined in the W3C specs and
various documents (WAI, HTML 4.01, WCAG). It should be short (under 100
characters) and it should only be used to add additional, complementary
info to the link text like defining the target of the link or mode of
opening the referenced resource (like opening a new secondary window).
The W3C documents insist on defining a meaningful link text, which can
be understood even without its context.
I would like to achieve the same with some text that is not a link.
I realized that I could simply make it
<a title="popup text">this is just some text</a>
My question: is it the best way to achieve what I want?
It depends on the element. The W3C documents discourage explicitly to
use title attribute on the following elements:
table
caption
img
and the W3C documents encourage explicitly to use title attribute when
needed, when it can help for the following elements:
a
abbr
acronym
frame
Are there alternative ways?
Is it portable?
Many user agents will not render the title attribute in a tooltip or
elsewhere: most text browsers. Keyboard navigation will not render the
title attribute in visual browsers.
What's important to remember is that the title attribute should be short
and should not hold crucial, important info in order to understand the
document or to navigate in the document.
Per the HTML 4.01 specification, the title attribute is allowed for
all elements except BASE, BASEFONT, HEAD, HTML, META, PARAM,
SCRIPT, and TITLE. Note that these eight elements do not create
visible content over which a cursor can be placed.
The specification does not indicate that the title attribute is
decprecated for the table, caption, or img elements. Indeed,
others strongly recommend the title attribute for the img element
where the Web author expects the alt attribute to produce a tooltip
for a visible image with a visual browser. They would reserve the
alt attribute only for situations in which the image is not
visible, not for producing a tooltip over a visible image. They
take the specification's description of the alt attribute:
"For user agents that cannot display images,
forms, or applets, this attribute specifies
alternate text."
as prohibiting any other use. Thus, the title attribute is
appropriate for such things as indicating copyright information for
an image or describing a link in which the image is the only inline
content of the anchor element.
Where my own pages have thumbnails of photographs as links to other
pages that have the full-sized photos, I use the title attribute in
the img tags (the inline contents of the links) to indicate the
download sizes of the pages with the full-size photos. These are
useful warnings for those users (almost half of those who access
the Internet from home) who still use dial-up modems.
--
David E. Ross
<URL:http://www.rossde.com/>
I use Mozilla as my Web browser because I want a browser that
complies with Web standards. See <URL:http://www.mozilla.org/>.