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

前端 未结 9 2339
悲&欢浪女
悲&欢浪女 2021-01-30 03:36

For example of a blog-post or article.

header

John My articl

9条回答
  •  梦谈多话
    2021-01-30 04:31

    According to the HTML5 spec, you probably want address.

    The address element represents the contact information for its nearest article or body element ancestor.

    The spec further references address in respect to authors here

    Under 4.4.4

    Author information associated with an article element (q.v. the address element) does not apply to nested article elements.

    Under 4.4.9

    Contact information for the author or editor of a section belongs in an address element, possibly itself inside a footer.

    All of which makes it seems that address is the best tag for this info.

    That said, you could also give your address a rel or class of author.

    Jason Gennaro

    Read more: http://dev.w3.org/html5/spec/sections.html#the-address-element

提交回复
热议问题