【问题标题】:Hidden Breadcrumbs Rich Snippet隐藏的面包屑丰富的片段
【发布时间】:2014-11-11 21:05:06
【问题描述】:

我想为我的网站实现面包屑,但我不想在我的页面上为它创建任何可见标签。我想过使用元标记,但由于它们没有 href 属性,它们不能包含 itemprop="url" 属性。以下是我正在使用的代码:

<div itemscope itemtype="http://data-vocabulary.org/Breadcrumb">
  <meta href="http://www.example.com/dresses" itemprop="url">
    <meta itemprop="title" content="Dresses">

</div>  
<div itemscope itemtype="http://data-vocabulary.org/Breadcrumb">
  <meta href="http://www.example.com/dresses/real" itemprop="url">
    <meta itemprop="title" content="Real Dresses">
</div>  
<div itemscope itemtype="http://data-vocabulary.org/Breadcrumb">
  <meta href="http://www.example.com/clothes/dresses/real/green" itemprop="url">
    <meta itemprop="title" content="Real Green Dresses">
</div>

有没有什么变通方法可以实现这一点?

【问题讨论】:

    标签: breadcrumbs microdata google-rich-snippets


    【解决方案1】:

    HTML5 定义 meta element

    […] 表示无法使用title、base、link、style 和script 元素表达的各种元数据。

    link element“允许作者将他们的文档链接到其他资源”。

    因此,如果值为 URI,则必须使用 link 而不是 meta。 (Microdata explicitly requires this 也是。)

    <div itemscope itemtype="http://data-vocabulary.org/Breadcrumb">
      <link itemprop="url" href="http://www.example.com/dresses">
      <meta itemprop="title" content="Dresses">
    </div> 
    

    【讨论】:

      【解决方案2】:

      根据 Google 服务条款,每个标记都必须对每个用户可见。 不要包含任何隐藏的标记,因为 Google 会惩罚您。

      【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-06-12
      • 2017-02-04
      • 1970-01-01
      • 2014-09-22
      • 1970-01-01
      相关资源
      最近更新 更多