schema.org product availability tags markup

故事扮演 提交于 2019-12-23 09:32:41

问题


Which one is correct?

<link itemprop="availability" href="http://schema.org/InStock">
​<meta itemprop="availability" content="InStock" />
<span itemprop="availability" content="in_stock"></span>

I checked official schema documentation and in examples found all of them.

I suppose all of them will work, but at the moment, is there any preferred standard?


回答1:


Using span with the content attribute is invalid. Neither HTML5 nor Microdata allow the content attribute for span.

Using meta is invalid. HTML5 and Microdata require that meta must not be used for URI values.

Using link is correct. It’s also used in Schema.org’s enumeration guide. If some examples use meta instead, we may expect these to be fixed.




回答2:


<link itemprop="availability" href="http://schema.org/InStock">

is probably best since it most closely adheres to the Enumeration that is https://schema.org/ItemAvailability.

I wouldn't use the 3rd example (<span itemprop="availability" content="in_stock"></span>) because in_stock may not map exactly to the values listed.



来源:https://stackoverflow.com/questions/25148439/schema-org-product-availability-tags-markup

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!