HTML and CSS Reference
In-Depth Information
title
The title attribute is used to provide advisory text about an element or its contents. Given
<p title="Hey look I am a title tooltip!">
This is the first paragraph of text.
</p>
the title attribute sets some message on this first paragraph. Browsers generally display this
advisory text in the form of a tooltip , as shown here:
In some cases, such as when applied to the a element, the title attribute can provide
additional help in bookmarking. Like the title for the document itself, title attribute
values such as advisory information should be short, yet useful. For example, <p title="A
paragraph"> provides little information of value, whereas <p title="HTML: The
Complete Reference - Title Example"> provides much more detail. The attribute can
take an arbitrary amount of text, but the wrapping and presentation of larger titles will
likely vary.
N OTE As of the writing of this edition, no formatting can be applied within advisory text, though
the HTML5 specification does indicate that Unicode linefeeds ( \u000A ) should eventually be
supported.
When combined with scripting, this attribute can provide facilities for automatic index
generation.
Language Attributes Reference
The use of other languages in addition to English in a Web page might require that the text
direction be changed from left to right or right to left or might require other localization
modifications. Once supporting non-ASCII languages becomes easier, it might be more
common to see documents in mixed languages. Thus, there must be a way to indicate the
language in use and its formatting. The basic language attributes are summarized here to
avoid redundancy.
dir
The dir attribute sets the text direction as related to the lang attribute. The accepted values
under the HTML 4.01 specification are ltr (left to right) and rtl (right to left). It should be
possible to override whatever direction a user agent sets by using this attribute with the bdo
element:
<div>
Standard text running left to right in most cases.
<bdo dir="rtl"> Napoleon never really said <q> Able was I ere
I saw Elba. </q></bdo> More standard text.
</div>
Search WWH ::




Custom Search