Which HTML5 tag should I use to mark up an author’

2020-05-11 11:22发布

For example of a blog-post or article.

<article>
<h1>header<h1>
<time>09-02-2011</time>
<author>John</author>
My article....
</article>

The author tag doesn't exist though... So what is the commonly used HTML5 tag for authors? Thanks.

(If there isn't, shouldn't there be one?)

9条回答
甜甜的少女心
2楼-- · 2020-05-11 11:49

You can use

<meta name="author" content="John Doe">

in the header as per the HTML5 specification.

查看更多
何必那么认真
3楼-- · 2020-05-11 11:49

If only for Google SEO, The valid answer as of 2020 is using the so called Structured Data.

More at :https://developers.google.com/search/docs/guides/intro-structured-data

查看更多
Melony?
4楼-- · 2020-05-11 11:54

HTML5 has an author link type:

<a href="http://johnsplace.com" rel="author">John</a>

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:

<span class="author">John</span>
查看更多
登录 后发表回答