我想使用 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>
最佳答案
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>
关于html - 在 <body> 中使用 HTML5+Microdata 的 <meta> 标签,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7293366/