HTML and CSS Reference
In-Depth Information
cite
The
cite
element designates the title of a quoted or referenced work: a book, poem, song, painting,
movie, magazine article, blog post, Wikipedia entry, technical specification, or what have you. In previous
versions of HTML, the
cite
element was intended for
any
cited resource, including the names of people.
But
cite
has been redefined in HTML5 to expressly forbid its use for the names of people (or other
entities); now you can only use cite for
titles of cited works
.
This decree seems arbitrary and unnecessarily limiting, but even worse, it breaches backward
compatibility with existing documents that rightfully used
cite
for names. But we're in luck: validators can't
read. There's no way for any user-agent—be it validator or browser—to tell whether the contents of a
cite
element are a title or a name, so this is one case where you shouldn't feel too guilty about bending the
rules. Use
cite
for names if you like.
“But what about following the rules?” you ask, shocked at the very suggestion of going against the HTML5
specification. Well, in the case of the
cite
element, the spec authors based the decision on somewhat
flawed reasoning. Because most browsers display
cite
elements in italics, and titles are usually italicized
but names are not, it was decided that
cite
shouldn't be used for names. This new restriction is based on
the
typical default styling
of the element, not on its semantic function or real-world usage.
If you're a stickler for adhering to the theoretical purity of technical specifications, then by all means use
cite
only for titles and never for names. But if your content includes a citation of a person, group,
company, character, or any other entity, especially in the context of a quotation, the
cite
element is a
semantically appropriate choice to mark their name. Perhaps, in time, the spec will be corrected.
For more on the flawed reasoning behind this limitation of the
cite
element, and how
our civil disobedience can bring about change in the specs, read Jeremy Keith's
wonderful rant,
Incite A Riot
(
24ways.org/2009/incite-a-riot
)
We've used the
cite
element three times in Listing 4-30: for a person's name, the title of an article, and
the name of a publication. Only the title is “correct” according to the current HTML5 specification, but all
three are semantically correct for the content at hand.
Listing 4-30.
Three different applications of the
cite
element
<p>Famed reporter
<cite>Norm Deplume</cite>
had this to say about
our shop:</p>
<blockquote cite="
http://example.com/gadgets/PowerOutfitters/">
<p>Power Outfitters Superhero Costume and Supply Company is
located in a nondescript building on Kirby Ave, a site that
once housed a large printing plant. Behind their modest
storefront is an expansive warehouse positively packed to
the portholes with paraphernalia.</p>
</blockquote>
<p class="source">
<cite>Where Do They Get Those Wonderful Toys?</cite>
,
<cite>Cape and Cowl Quarterly</cite>
, August 9, 2011</p>