title Attributetitle Attributetitle is a Common Attribute from the
Core Attribute Collection
and is of Type Text.
It may be used on most elements in the Element Index - all except: base, head, html, meta, param, script, title.
Almost any element within the body
element (including body itself)
may be given a descriptive title using the common
title attribute. In some user agents this
title may appear briefly as a "tooltip" when the mouse hovers over the element.
The title attribute is particularly useful on
abbr and
acronym elements
where it is used to specify the full text for the abbreviation contained
within the element. It may also be used on an a
element to provide additional information to the user about the link's target
URI.
Notes:
title elements within the tooltip so that
not all of the title text is visible. However, the tooltip generally
disappears after only a short time so there might not be enough time to read
long titles anyway.title attributes at all (e.g. those users who use
purely keyboard navigation in most graphical browsers) so the information
within them should not be crucial to the understanding
of the page, but instead merely help to elucidate such information as is
already present.alt
attributes of images in a tooltip by default. Specifying a title
should override this behaviour. Specifying an empty string as a title
may prevent display of any unwanted alt attribute
tooltips.The only elements within the head element which may be given
a title attribute are: link, style and object.
For those link elements which do not link to stylesheets, the
title attribute allows the author to provide more information to the user
about the content being linked to - in addition to the relationship specified
in the rel or rev attribute. (Bear in mind, however, that not all user
agents allow link elements to be accessed by the user or, even if they do,
they may not display this title information.)
For link elements which link to stylesheets, the title attribute has
additional meaning. It defines a name for the preferred
(rel="stylesheet") or alternate (rel="alternate stylesheet")
author styles.
All stylesheets linked using that particular title should be grouped together by the
user agent into a single combined stylesheet. Without any title attribute,
the linked stylesheet is a persistent stylesheet, which is always loaded (in
addition to the preferred styles or selected alternate styles).
Some user agents allow the user to choose between the preferred
author styles and the alternate stylesheets specified - if so,
it is usually the title attribute for each choice which is presented to the
user; informative title text is therefore advised. See the W3C Recommendation
*HTML 4.01 - External style sheets
for more information.
I cannot currently find it specified anywhere how style elements with
title attributes are meant to be treated with respect to persistent, preferred or
alternate stylesheets. Without title attributes, however, style
elements act as persistent stylesheets.
Not all user agents support alternate stylesheets and, personally, I usually find that sticking with persistent style sheets is all that is required (unless more than one style has been requested). However, if you do want to switch easily between different stylesheets during the development process, alternate stylesheets can be useful (if you're using a browser which supports them, e.g. Firefox).