【发布时间】:2011-09-03 13:25:02
【问题描述】:
我想使用 HTML5+Microdata 的 <meta> 标签使用 Schema.org 指定产品是否“有货”。
我不确定这是否是正确的语法:
<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>
【问题讨论】:
-
你在 google 的 Rich Snippet Testing Tool 中查看过它的样子吗?
-
@Oded 无法检查,因为我的网站没有上传。此外,有时即使语法不正确,工具也会正确提取内容!那么...语法正确吗?
-
我认为混乱可能源于Google Merchant Center help topic。它显示了这一点:
<meta itemprop="availability" itemtype="http://schema.org/ItemAvailability" content="http://schema.org/InStock"/> -
@bluescrubbie 我很惊讶谷歌支持这种语法。尽管
itemtype在技术上是一个全局属性,但我从未见过meta元素在野外使用它。 developer.mozilla.org/en-US/docs/Web/HTML/Element/meta
标签: html meta schema.org microdata