HTML and CSS Reference
In-Depth Information
<span class="conference" id="javaone07">JavaOne</span>
Often the
i
element means something, but not emphasis. One common use is to indicate the title of something:
a book, a newspaper, an article, and so on. This is better handled in strict HTML with the underused
cite
element. For example:
<cite>My Sister Eileen, pg. 9</cite>
Most graphical browsers style the
cite
element as italic.
Another common use of italics is to indicate foreign words in English text. These can be noted in HTML with the
lang
or
xml:lang
attribute. For example:
I greeted Pierre with a hearty
<span xml:lang="fr">Bon jour!</span>
There are many other uses of italics in text. Some of the more common include the following.
Names of legal cases, for example,
Eldred v. Ashcroft
Epigraphs at the heads of book chapters
Words used as words: It's hard to spell
necessarily
Words that imitate sounds:
D'oh!
Genus and species, for example,
Aix sponsa
The words
see
and
see also
in cross references and indexes for example,
see also
the Chicago Manual of
Style, Section 17.18.
HTML does not have individual elements representing these uses. Instead, they should be indicated by a
span
or
div
element whose
class
attribute indicates the reason for formatting the text as italic:
The drake Wood Duck
(<span class="species">Aix sponsa</span>) is
the prettiest waterfowl.
Similar techniques should be used for nontraditional uses of italics, such as the earlier conference example or
indicating the external links on a page. Indeed, it's even more important to use external CSS for these elements
because you're even more likely to want to change the style as part of a redesign. If you later decide that
conference names should be colored red instead of italicized, it's relatively hard to find all the conferences in
your site. It's relatively easy to change the one line in a CSS stylesheet that formats elements with
class="conference"
.
Search WWH ::
Custom Search