我应该使用哪个 HTML5 标签来标记作者姓名?
例如博客文章或文章。
<article>
<h1>header<h1>
<time>09-02-2011</time>
<author>John</author>
My article....
</article>
但是 author
标签并不存在...那么作者常用的 HTML5 标签是什么?
谢谢。
(如果没有的话,难道不应该有吗?)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(9)
两者
rel="作者”
和< ;地址>
是专为此目的而设计。 HTML5 均支持这两种方式。规范告诉我们rel="author"
可用于和
和
rel="author"
似乎是最佳选择。 HTML5 最适合包装中的标题和署名信息如下所示:
pubdate
属性表明这是发布日期。title
属性是可选的 Flyover。署名信息也可以包含在
中
rel="noreferrer">
如果您想要添加 hcard 微格式,那么我会这样做:
Both
rel="author"
and<address>
are designed for this exact purpose. Both are supported in HTML5. The spec tells us thatrel="author"
can be used on<link>
<a>
, and<area>
elements. Google also recommends its usage. Combining use of<address>
andrel="author"
seems optimal. HTML5 best affords wrapping<article>
headlines and bylines info in a<header>
like so:The
pubdate
attribute indicates that that is the published date.The
title
attributes are optional flyovers.The byline info can alternatively be wrapped in a
<footer>
within an<article>
If you want to add the hcard microformat, then I would do so like this:
HTML5 有一个 作者链接类型< /a>:
这里的弱点是它需要位于某种链接上,但如果有的话,就会有一个 这里对替代方案进行了长时间的讨论。如果您没有链接,则只需使用类属性,这就是它的用途:
HTML5 has an author link type:
The weakness here is that it needs to be on some sort of link, but if you have that there's a long discussion of alternatives here. If you don't have a link, then just use a class attribute, that's what it's for:
根据 HTML5 规范,您可能需要
地址
。该规范进一步参考了此处
4.4.4
4.4.9以下
所有这些都使得
address
似乎是此信息的最佳标记。也就是说,您还可以为您的
地址
指定一个author
的rel
或class
。了解更多:http://dev.w3.org/html5/ spec/sections.html#the-address-element
According to the HTML5 spec, you probably want
address
.The spec further references
address
in respect to authors hereUnder 4.4.4
Under 4.4.9
All of which makes it seems that
address
is the best tag for this info.That said, you could also give your
address
arel
orclass
ofauthor
.Read more: http://dev.w3.org/html5/spec/sections.html#the-address-element
在 HTML5 中,我们可以使用一些语义标签来帮助组织有关您的内容类型的信息,但与主题相关的其他信息您可以检查 schema。组织。它是谷歌、必应和雅虎的一项倡议,旨在帮助搜索引擎通过微数据属性更好地理解网站。您的帖子可能如下所示:
In HTML5 we can use some semantic labels that help organize the information regarding your type of content, but additional and related to the subject you can check schema.org. It is an initiative of Google, Bing and Yahoo that aims to help search engines to better understand websites through microdata attributes. Your post could look like this:
Google 对 rel="author" 的支持已弃用:
使用描述列表(HTML 4.01 中的定义列表)元素。
来自 HTML5 规范:
作者身份和其他文章元信息完全符合此键:值对结构:
一个固执己见的示例:
正如你可以的请参阅,当使用
元素作为文章元信息时,我们可以自由地包装
、
和甚至
和/或
标记(根据内容的性质)和它的预期功能。
、
和
;
、
和
同样可以自由地完成它们的工作——同样,从语义上来说——传达分别涉及在哪里找到相关内容、非语言视觉呈现以及权威机构的联系方式的信息。
Google support for rel="author" is deprecated:
Use a Description List (Definition List in HTML 4.01) element.
From the HTML5 spec:
Authorship and other article meta information fits perfectly into this key:value pair structure:
An opinionated example:
As you can see when using the
<dl>
element for article meta information, we are free to wrap<address>
,<a>
and even<img>
tags in<dt>
and/or<dd>
tags according to the nature of the content and it's intended function.The
<dl>
,<dt>
and<dd>
tags are free to do their job -- semantically -- conveying information about the parent<article>
;<a>
,<img>
and<address>
are similarly free to do their job -- again, semantically -- conveying information regarding where to find related content, non-verbal visual presentation, and contact details for authoritative parties, respectively.您可以按照
HTML5 规范。
You can use
in the header as per the HTML5 specification.
如果您要包含作者的详细联系信息,则
标记是合适的:
但如果它实际上只是作者姓名,没有特定的标签。 HTML 不包含太多与人相关的内容。
If you were including contact details for the author, then the
<address>
tag is appropriate:But if it’s literally just the author’s name, there isn’t a specific tag for that. HTML doesn’t include much related to people.
微数据怎么样:
How about microdata:
您可以使用元标记来实现此目的,如下所示:
You may use meta tag for this purpose, as follows: