HTML and CSS Reference
In-Depth Information
The only trouble with <time> is that it must contain a positive
date on the Proleptic Gregorian calendar—meaning you can't
encode a date before the Christian Era. Neither can you encode
imprecise dates such as “July 1904.” This seriously limits its use
for sites such as museums, history/encyclopedia pages, or fam-
ily trees, where precise dates may not be known.
The pubdate attribute
pubdate is a Boolean attribute to indicate that this particular <time>
is the publication date of an <article> or the whole <body> content.
Yo u m i g h t b e w o n d e r i n g w h y t h e pubdate attribute is needed
at all. Why not just assume that any <time> element in an
<article> 's <header> is its publication date?
Consider this example:
<article>
<header>
<h1>Come to my party on <time datetime=2010-12-01>1
¬ December</time></h1>
<p>Published on <time datetime=2010-06-20 pubdate>20
¬ June 2010</time></p>
</header>
<p>I'm throwing a party at Dr Einstein's Cabaret
¬ Roller-disco Bierkeller Pizza-parlour-a-gogo. Do come
¬ and dance to Rusty Trombone's Swingin' Brass Band.
¬ (Formal dress and lewd hat required.)</p>
</article>
Yo u ' l l s e e t h a t t h e r e a r e t w o d a t e s w i t h i n t h e <header> : the date
of the actual party and the publication date of the article. The
pubdate attribute is required to remove any ambiguity. And yes,
you are invited—just don't get drunk this time.
More fun with headers and footers
This main surprise with our article makeover is that each article
can have its own <header> and <footer> . This means that, in
addition to the “main” header and footer on a page, each article
can have its own headers and footers. They can be separately
styled with CSS: body>header and body>footer target the “main”
headers and footers (assuming that they're direct descendants
of <body> ), whereas article>header and article>footer target
the inner structures.
 
Search WWH ::




Custom Search