Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Clarification on the HTML5 pubdate attribute

Tags:

html

Can some one explain to me in layman's terms what the following sentences, from the W3C specification working draft, below mean about the pubdate attribute for the time element below.

For each article element, there must be no more than one time element with a pubdate attribute whose nearest ancestor is that article element. Furthermore, for each Document, there must be no more than one time element with a pubdate attribute that does not have an ancestor article element.

like image 770
HELP Avatar asked Oct 22 '25 07:10

HELP


1 Answers

It means that time value is related to time when article is published. That is info for robots or some machine which reads content.

<article>
 <header><h1>Article Title</h1></header>
 <footer>Published on <time pubdate>2009-08-30</time>.</footer>
 <p>I put a bike bell on his bike.</p>
</article>

As above, the time tag is used to tell for instance to google search engine when article was published in public.

Ancestor, means, nearest parent article tag for time tag. Ancestor can be grand parent or grand grand parent. Depends how much time tag is nested deep in DOM tree. It can be N-th generation child while no article tag is in between.

like image 174
Milan Jaric Avatar answered Oct 23 '25 20:10

Milan Jaric



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!