HTML5发布和修改时间 [英] HTML5 published and modified time

查看:145
本文介绍了HTML5发布和修改时间的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想包括文章的发布和修改时间。我看过文档,找不到有关这方面的信息。



到目前为止,我得到了这个:

 < article> 
< h2> Summer< / h2>
< p>也是< strong> 5000< / strong>更多人< / p>
< time pubdate =2009-11-13> 1s< / time>
< time datetime =2009-11-13> 10s< / time>
< / article>


解决方案

time 不能有 pubdate 属性。 (这是早期草稿的一部分,但已被删除。)



HTML5本身不提供指定日期是发布或修改日期的方法。



如果您需要以机器可读的方式指定,可以使用适当的词汇表。例如,词汇 Schema.org 定义了属性 datePublished dateModified CreativeWork (及其子类型)。


I’d like to include published and modified time of an article. I looked through documentation and cannot find info about this.

So far, I got this:

<article>                           
  <h2>Summer</h2>
  <p>Also the favorite word of <strong>5000</strong> people more</p>
  <time pubdate="2009-11-13">1s</time>
  <time datetime="2009-11-13">10s</time>
</article>

解决方案

The time element can’t have a pubdate attribute. (It was part of early drafts, but it got removed.)

HTML5 itself doesn’t provide a way to specify that a date is a publication or a modification date.

If you need to specify this in a machine-readable way, you could use an appropriate vocabulary. For example, the vocabulary Schema.org defines the properties datePublished and dateModified for CreativeWork (and its sub-types).

这篇关于HTML5发布和修改时间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆