'itemprop' and 'rel' attributes on same element

依然范特西╮ 提交于 2019-12-05 09:51:05

It depends on the specification.

Microdata, where the itemprop attribute is coming from, is defined by WHATWG’s HTML as well as by W3C’s HTML Microdata.

The WHATWG version is a living standard without snapshots (so things might change; my quotes are from 2015-07-25), the W3C version is currently only a Working Group Note from 2013, no Recommendation.

For the a element and the area element:

  • both specifications allow to use the attributes itemprop and rel together

For the link element:

  • WHATWG: it’s disallowed to use the attributes together

    link element:

    A link element must have either a rel attribute or an itemprop attribute, but not both.

  • W3C: it’s allowed to use the attributes together

    Content models:

    If a link element has an itemprop attribute, the rel attribute may be omitted.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!