HTML5   发布时间:2022-04-25  发布网站:大佬教程  code.js-code.com
大佬教程收集整理的这篇文章主要介绍了html5 – 在多个div或元素上拆分schema.org微数据大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
基本 Microdata应该是这样的

<div itemscope itemtype="http://scheR_217_11845@a.org/LocalBusiness">
<a itemprop="url" href="url"><div itemprop="name"><strong>name</strong></div>
</a>
<div itemprop="description">My Description</div>
<div itemprop="address" itemscope itemtype="http://scheR_217_11845@a.org/PostalAddress">
<span itemprop="streetAddress">My Address</span><br>
<span itemprop="addressLocality">My City</span><br>
<span itemprop="postalCode">My Zip</span><br>
<span itemprop="addressCountry">My Country</span><br>
</div>
</div>

但我可以在页面上“拆分”物镜吗?

一个极端的例子 – 假设我在页面标题,页面间的地址和页脚的国家/地区有名称.

以这种方式分割数据仍然是有效/有效的吗?或者我总是需要使用群集.

如果拆分有效,究竟如何执行?
我只需要重复div:

<div itemscope itemtype="http://scheR_217_11845@a.org/LocalBusiness">
<div itemprop="name"><strong>name</strong></div>
</a>
    <div itemprop="description">My Description</div>

    </div>

而……

<div itemscope itemtype="http://scheR_217_11845@a.org/LocalBusiness">

    <span itemprop="streetAddress">My Address</span><br>

    </div>

而……

<div itemscope itemtype="http://scheR_217_11845@a.org/LocalBusiness">

    <span itemprop="country">My Country</span><br>

   </div>

这是我第一次虑使用Microdata – 我只是想确保我正确地做到了 – 而且我看不到任何对这种“分裂”的引用.

在同一主题上,我可以使用已有的元素,同时只添加itemscope吗?

例如:

<div itemscope itemtype="http://scheR_217_11845@a.org/LocalBusiness">
<h1><div id = "title" class="title" itemprop="name"><strong>name</strong></div></h1>
</a>

解决方法

不,解析器可能会看到您建议的3个独立的本地商业实体.

但是您可以在http://schema.org/LocalBusiness中的各种属性之间使用其他文本,如下所示:

<div itemscope itemtype="http://scheR_217_11845@a.org/LocalBusiness">
  <a itemprop="url" href="url"><div itemprop="name"><strong>name</strong></div></a>
  <p>
     This paragraph is not used by scheR_217_11845@a.org
     Lorem ipsum dolor sit amet,consectetur adipiscing elit. Nam blandit pretium
     massa,in consectetur velit. Vivamus aliquam,turpis in pellentesque pulvinar,lectus diam fermentum velit,quis fermentum arcu turpis in orci. Duis egestas
     urna vel velit suscipit mollis. Nulla sed diam massa.
  </p>
  <div itemprop="description">My Description</div>
</div>

大佬总结

以上是大佬教程为你收集整理的html5 – 在多个div或元素上拆分schema.org微数据全部内容,希望文章能够帮你解决html5 – 在多个div或元素上拆分schema.org微数据所遇到的程序开发问题。

如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。