在<body>中使用HTML5 + Microdata的<meta>标签

jac*_*333 5 meta html5 microdata schema.org

我想<meta>使用Schema.org使用HTML5 + Microdata 标签指定产品是否为"库存" .

我不确定这是否是正确的语法:

<div itemscope itemtype="http://schema.org/Product">
  <h2 itemprop="name">Product Name</h2>
  <dl itemprop="offers" itemscope itemtype="http://schema.org/Offer">
    <dt itemprop="price">$1</dt>
    <meta itemprop="availability" itemscope itemtype="http://schema.org/ItemAvailability" itemid="http://schema.org/InStock">
  </dl>
</div>
Run Code Online (Sandbox Code Playgroud)

Law*_*man 9

meta标签不能用那种的itemscope使用.表达这一点的正确方法是使用link标记的规范引用:

<div itemscope itemtype="http://schema.org/Product">
  <h2 itemprop="name">Product Name</h2>
  <dl itemprop="offers" itemscope itemtype="http://schema.org/Offer">
    <dt itemprop="price">$1</dt>
    <link itemprop="availability" href="http://schema.org/InStock">
  </dl>
</div>
Run Code Online (Sandbox Code Playgroud)

  • 它位于schema.org上的文档中:[枚举和规范引用:使用与href的链接](http://schema.org/docs/gs.html#advanced_enum) (2认同)

Ric*_*haw 0

我在这里制作了一个jsfiddle: http: //jsfiddle.net/dLryX/,然后将输出(http://jsfiddle.net/dLryX/show/)放入丰富的片段工具中。

返回结果是:

在此输入图像描述

我相信语法是正确的,并且警告并不重要,因为它没有属性,因为它是元标记。