本文介绍了构造面包屑的问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用以下html来构造面包屑:

I have the following html to structure my breadcrumbs:

<ul class="browsePageBC">
   <li class="product-breadcrumb" itemscope="" itemtype="http://data-vocabulary.org/Breadcrumb"><a href="/Wanita" itemprop="url" alt="" title="Wanita"><span class="product-breadcrumb-title" itemprop="title">Wanita</span></a><span class="glyphicon glyphicon-chevron-right"></span></li>
   <li class="product-breadcrumb" itemprop="child" itemtype="http://data-vocabulary.org/Breadcrumb"><a href="/Wanita/Aksesoris" itemprop="url" alt="" title="Aksesoris"><span class="product-breadcrumb-title" itemprop="title">Aksesoris </span></a></li>
</ul>

当我在结构化数据测试工具上进行测试时,它给我的。想知道为什么它不能正确显示/解析孩子吗?

When I tested this on structured data testing tools, this is what it gives me. Wondering why it's not showing/parsing the child correctly?

推荐答案

下面的示例代码将帮助您声明父级和子级属性

Following sample code will help you to declare the parent and child property

<div id="breadcrumb">
    <span itemscope itemtype="http://data-vocabulary.org/Breadcrumb">
        <a rel="home" href="http://www.example.com" itemprop="url">
          <span itemprop="title">Home</span>
        </a> ›
        <span itemprop="child" itemscope itemtype="http://data-vocabulary.org/Breadcrumb">
            <a href="http://www.example.com/topic/technology/" itemprop="url">
              <span itemprop="title">Technology</span>
            </a> ›
            <span itemprop="child" itemscope itemtype="http://data-vocabulary.org/Breadcrumb">
                <a href="http://www.example.com/tag/gadgets/" itemprop="url">
                  <span itemprop="title">Gadgets</span>
                </a> ›
                <span>Sweet Post Title Goes Here</span>
            </span>
        </span>
    </span>
</div>

让我知道这些代码是否对您有所帮助。

Let me know if these code help on your way.

这篇关于构造面包屑的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-23 17:18
查看更多