HTML itemid 全域性屬性
itemid 全域性屬性 以專案的唯一全域性識別符號形式提供微資料。
itemid 屬性只能為同時具有 itemscope 和 itemtype 屬性的元素指定。此外,itemid 只能在擁有 itemscope 屬性的元素上指定,該 itemscope 屬性對應的 itemtype 指向或定義了支援全域性識別符號的詞彙表。
itemtype 的全域性識別符號的確切含義由指定詞彙表中該識別符號的定義提供。詞彙表定義了具有相同全域性識別符號的多個專案是否可以共存,如果可以,則如何處理具有相同識別符號的專案。
示例
表示一本書的結構化資料
此示例使用微資料屬性來表示以下結構化資料
| itemscope | itemtype: itemid | https://schema.org/Book: urn:isbn:0-374-22848-5 | |
| itemprop | title | 東方冰雪貓頭鷹 | |
| itemprop | author | Jonathan C Slaght | |
| itemprop | 出版日期 | 2020-08-04 | |
HTML
html
<dl
itemscope
itemtype="https://schema.org/Book"
itemid="urn:isbn:0-374-22848-5<">
<dt>Title</dt>
<dd itemprop="title">Owls of the Eastern Ice</dd>
<dt>Author</dt>
<dd itemprop="author">Jonathan C Slaght</dd>
<dt>Publication date</dt>
<dd>
<time itemprop="datePublished" datetime="2020-08-04">August 4 2020</time>
</dd>
</dl>
結果
規範
| 規範 |
|---|
| HTML # attr-itemid |