directory search
Attributes accesskey (attribute) class (attribute) contenteditable (attribute) contextmenu (attribute) data-* (attribute) dir (attribute) draggable (attribute) dropzone (attribute) Global attributes hidden (attribute) id (attribute) itemid (attribute) itemprop (attribute) itemref (attribute) itemscope (attribute) itemtype (attribute) lang (attribute) slot (attribute) spellcheck (attribute) style (attribute) tabindex (attribute) title (attribute) translate (attribute) Elements a abbr address area article aside audio b base bdi bdo blockquote body br button canvas caption cite code col colgroup data datalist dd del details dfn dialog div dl dt em embed fieldset figcaption figure footer form h1 head header hr html i iframe img input input type="button" input type="checkbox" input type="color" input type="date" input type="datetime"-local input type="email" input type="file" input type="hidden" input type="image" input type="month" input type="number" input type="password" input type="radio" input type="range" input type="reset" input type="search" input type="submit" input type="tel" input type="text" input type="time" input type="url" input type="week" ins kbd label legend li link main map mark menu menuitem meta meter nav noscript object ol optgroup option output p param picture pre progress q rp rt rtc ruby s samp script section select slot small source span strong style sub summary sup table tbody td template textarea tfoot th thead time title tr track u ul var video wbr Miscellaneous Attributes Block-level elements CORS enabled image CORS settings attributes Element Inline elements Kinds of HTML content Link types Microdata Optimizing your pages for speculative parsing Preloading content Reference Supported media formats Using the application cache Obsolete acronym applet basefont big blink center command content dir element font frame frameset hgroup image input type="datetime" isindex keygen listing marquee nextid noframes plaintext strike tt xmp
characters

全局属性itemtype指定将用于定义itemprop数据结构中的(项目属性)的词汇表的URL 。itemscope用于设置数据结构中设置的词汇itemtype将处于活动状态的范围。

谷歌和其他主要的搜索引擎支持schema.org词汇表的结构化数据。这个词汇表定义了一组标准的类型名称和属性名称。例如,MusicEvent表示音乐会表演,startDate以及location指定音乐会关键细节的属性。在这种情况下,MusicEvent  itemtype,与startDateMusicEvent定义的位置将被itempropURL使用。

注意:关于itemtype属性的更多信息可以在http://schema.org/Thing找到

  • 项目类型属性必须有一个值是一组无序独特标记,其区分大小写的,各是一个有效的和绝对的URL,并且所有定义为使用相同的词汇。该属性的值必须至少有一个令牌。

  • 项目类型必须全都是适用规范中定义的类型(如schema.org),并且必须全部定义为使用相同的词汇表。

  • itemtype属性只能在指定了itemscope属性的元素上指定。

  • itemid属性只能在同时指定了itemscope属性和itemtype属性的元素上指定。它们只能在具有itemscope属性的元素上指定,其itemtype属性指定不支持项目的全局标识符的词汇表,如词汇表规范所定义。

  • 全局标识符的确切含义由词汇表的规范决定。留下这样的规范来定义是否允许相同全局标识符(无论在同一页面还是不同页面上)的多个项目存在,以及该词汇表的哪些处理规则是关于处理多个项目的情况相同的ID。

简单的例子

HTML

<div itemscope itemtype="http://schema.org/Product">  <span itemprop="brand">ACME</span>  <span itemprop="name">Executive Anvil</span></div>

结构化数据

itemscope

itemtype

schema.org Product

itemprop

name

Executive Anvil

itemprop

brand Thing


itemprop

name

ACME

样例

HTML

<div itemscope itemtype="http://schema.org/Product">  <span itemprop="brand">ACME<br></span>  <span itemprop="name">Executive Anvil<br></span>  <img itemprop="image" src="https://pixabay.com/static/uploads/photo/2015/09/05/18/15/suitcase-924605_960_720.png" width="50" height="50" alt="Executive Anvil logo" /><br>  <span itemprop="description">Sleeker than ACME's Classic Anvil, the
    Executive Anvil is perfect for the business traveler
    looking for something to drop from a height.  <br></span>

  Product #: <span itemprop="mpn">925872<br></span>  <span itemprop="aggregateRating" itemscope itemtype="http://schema.org/AggregateRating">
    Rating: <span itemprop="ratingValue">4.4</span> stars, based on <span itemprop="reviewCount">89      </span> reviews  </span><p>  <span itemprop="offers" itemscope itemtype="http://schema.org/Offer">
    Regular price: $179.99<br>    <meta itemprop="priceCurrency" content="USD" />    <span itemprop="price">Sale price: $119.99<br></span>    (Sale ends <time itemprop="priceValidUntil" datetime="2020-11-05">      5 November!</time>)<br>
    Available from: <span itemprop="seller" itemscope itemtype="http://schema.org/Organization">                      <span itemprop="name">Executive Objects<br></span>                    </span>
    Condition: <link itemprop="itemCondition" href="http://schema.org/UsedCondition"/>Previously owned,      in excellent condition<br>    <link itemprop="availability" href="http://schema.org/InStock"/>In stock! Order now!</span></div>

结果

HTML

结构化数据

itemscope

itemtype

Product (http://schema.org/Product)


itemprop

name

Executive Anvil


itemprop

image

https://pixabay.com/static/uploads/photo/2015/09/05/18/15/suitcase-924605_960_720.png


itemprop

description

Sleeker than ACME's Classic Anvil, the Executive Anvil is perfect for the business traveler looking for something to drop from a height.


itemprop

mpn

925872


itemprop

brand Thing



itemprop

name

ACME


itemscope

itempropitemtype

aggregateRatingAggregateRating


itemprop

ratingValue

4.4


itemprop

reviewCount

89


itemprop

offers Offer

http://schema.org/Offer


itemprop

priceCurrency

USD


itemprop

price

119.99


itemprop

priceValidUntil

2020-11-05


itemprop

itemCondition

http://schema.org/UsedCondition


itemprop

availability

http://schema.org/InStock


itemscope

itempropitemtype

seller Organization

http://schema.org/Organization

itemprop

name

Executive Objects


注意:用于从HTML中提取微数据结构的便捷工具是Google的结构化数据测试工具。试试上面显示的HTML

产品规格

规范

状态

评论

物品种类


工作组注意事项 - 不再积极发展

浏览器兼容性

Feature

Chrome

Firefox (Gecko)

Internet Explorer

Opera

Safari

Basic support

(Yes)

(Yes)

(Yes)

(Yes)

(Yes)

Feature

Android

Chrome for Android

Firefox Mobile (Gecko)

IE Mobile

Opera Mobile

Safari Mobile

Basic support

(Yes)

(Yes)

(Yes)

(Yes)

(Yes)

(Yes)

Previous article: Next article: