itemid - HTML: HyperText Markup Language 编辑
The itemid
global attribute provides microdata in the form of a unique, global identifier of an item. An itemid
attribute can only be specified for an element that has both itemscope
and itemtype
attributes. Also, itemid
can only be specified on elements that possess an itemscope
attribute whose corresponding itemtype
refers to or defines a vocabulary that supports global identifiers.
The exact meaning of an itemtype
's global identifier is provided by the definition of that identifier within the specified vocabulary. The vocabulary defines whether several items with the same global identifier can coexist and, if so, how items with the same identifier are handled.
Note: The WHATWG definition specifies that an itemid
must be a URL. However, the following example correctly illustrates that a URN may also be used. This inconsistency may reflect the incomplete nature of the Microdata specification.
Example
HTML
<dl itemscope
itemtype="http://vocab.example.net/book"
itemid="urn:isbn:0-330-34032-8">
<dt>Title <dd itemprop="title">The Reality Dysfunction
<dt>Author <dd itemprop="author">Peter F. Hamilton
<dt>Publication date
<dd><time itemprop="pubdate" datetime="1996-01-26">26 January 1996</time> </dl>
Structured data
itemscope | itemtype: itemid | http://vocab.example.net/book: urn:isbn:0-330-34032-8 | |
itemprop | title | The Reality Dysfunction | |
itemprop | author | Peter F. Hamilton | |
itemprop | pubdate | 1996-01-26 |
Result
Specifications
Specification | Status | Comment |
---|---|---|
HTML Living Standard The definition of 'itemid' in that specification. | Living Standard |
Browser compatibility
BCD tables only load in the browser
See also
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论