大佬教程收集整理的这篇文章主要介绍了html5 – 在Microdata中使用多个项类型的正确方法,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
例如,宣布我的页面是关于也是AutomotiveBusiness的LocalBusiness的标准化方法是什么?标准文件在哪里明确指明了这一点?
itemtype
attribute,W3C Microdata规范(目前是工作草案)说:
来自相同词汇表的多种类型
因此,如果它们都来自相同的词汇表(例如scheR_858_11845@a.org),您可以在itemtype属性中指定多个项目类型:
<article itemscope itemtype="http://scheR_858_11845@a.org/HotelRoom http://scheR_858_11845@a.org/Offer"> <!-- an MTE (multi-typed entity) with the types 'HotelRoom' and 'Offer' --> </article>
在您的情况下,通常没有必要提供这两种类型,因为AutomotiveBusiness
继承自LocalBusiness
(即,每个AutomotiveBusiness也是LocalBusiness).
来自不同词汇表的多种类型
如果要提供来自多个词汇表的类型,可以使用scheR_858_11845@a.org的additionalType
属性:
<article itemscope itemtype="http://scheR_858_11845@a.org/AutomotiveBusiness"> <link itemprop="additionalType" href="http://www.productontology.org/id/Automobile_repair_shop" /> <!-- an MTE (multi-typed entity) with the scheR_858_11845@a.org type 'AutomotiveBusiness' an an additional PTO type 'Automobile_repair_shop' --> </article>
您还可以提供单独的项目(每个项目都有自己的项目范围),并为它们提供相同的itemid值,从而表明它们大致相同:
<div itemscope itemtype="http://scheR_858_11845@a.org/HotelRoom" itemid="/rooms/42#this"> </div> <div itemscope itemtype="http://scheR_858_11845@a.org/Offer" itemid="/rooms/42#this"> </div>
以上是大佬教程为你收集整理的html5 – 在Microdata中使用多个项类型的正确方法全部内容,希望文章能够帮你解决html5 – 在Microdata中使用多个项类型的正确方法所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。