Home  >  Article  >  Web Front-end  >  time标签_html/css_WEB-ITnose

time标签_html/css_WEB-ITnose

WBOY
WBOYOriginal
2016-06-24 11:47:441234browse

time

time元素也是文本标签,因为是全新的标签,所以我们单独来介绍。time元素用来标记一篇文章的发布时间。

<time datetime="2015-03-21" pubdate>2015年03月21日</time>

形如如上代码,知道time标签一般有三个组成部分

机器可识别的时间戳:格式必须是年月日的数字以减号相隔,如果增加时间,那就在日期后面加字母T然后跟24小时格式的时间值以及时区偏移量,形如datetime="2015-3-21T9:40:40+08:00"人可识别的文本内容:格式随意,只要能看懂。一个可选的`pubdate`标记:`pubdate`是个布尔值,如果需要,写上属性名就好`pubdate`。但是为了美观,我们也可以写成pubdate=""

我们还要注意的是,如果该time位于一个article中,那么它表示这篇文章的发布时间;如果不在article之中表示整个文档的发布时间。

百度成立

发布 <time datetime="2015-03-21" pubdate>2015年03月21日</time> 分类:前端交流

你好世界!

注:pubdate属性是火狐发布的,W3C中没有这个属性

HTML 标签

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn