html - Microdata schema.org 中多次出现相同的 itemprop

标签 html microdata schema.org

我在 Google 上测试了我的微数据 schema.org:

谷歌工具没有返回任何错误...

**Item** 
    type:   http://schema.org/webpage
    property:   
    url:    http://127.0.0.1/
    image:  http://127.0.0.1/design/logo.jpg
    datemodified:   2014-03-05 20:12:56
    text:   
    Item 1
    breadcrumb: Skip to content
    text:   
    Item 2



    **Item 1**
    type:   http://schema.org/wpheader
    property:   
    url:    http://127.0.0.1
    headline:   website name
    image:  http://127.0.0.1/design/logo.jpg
    description:    some text


    **Item 2**
    type:   http://schema.org/sitenavigationelement

您可以看到我使用了多个 itemprop="text"作为网页类型...

有效吗?

如果是,您知道网页类型的 itemprop="url"无效...或者 ItemList 的 itemListElement 有效。我如何识别哪个 itemprop 有效,哪个 itemprop 无效?

----------------///编辑///--------------------------------

<html itemscope itemtype="http://schema.org/webpage">
<body>
<div itemprop="text" itemscope="itemscope" itemtype="http://schema.org/wpheader">
...
</div>

<div itemprop="text" itemscope="itemscope" itemtype="http://schema.org/SiteNavigationElement">
...
</div>
</body>
</html>

最佳答案

对于同一个项目,您可以多次使用相同的属性(例如,到 specify Schema.org’s name in different languages )。但请注意Microdata doesn’t define what it should mean当同一属性被指定多次时。

所以像这样的事情完全没问题:

<html itemscope itemtype="http://schema.org/WebPage">
  <body>
    <div itemprop="text">…</div>
    <div itemprop="text">…</div>
  </body>
</html>

(请注意,您的具体示例可能存在问题:Schema.org 的 text property 需要 Text,但您正在使用另一个项目作为值。不过,这并不被禁止。)

(另请注意,大小写很重要,因此必须是 http://schema.org/WPHeader 而不是 http://schema.org/wpheader .与http://schema.org/WebPage相同。)

关于html - Microdata schema.org 中多次出现相同的 itemprop,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22330275/

相关文章:

javascript - JQuery fadeIn() 不工作——简单的例子

php - 不用 java/jquery 改变页面标题

breadcrumbs - 带有 Schema.org 的 Breadcrumb 未显示在 Google Rich Snippets 测试工具中

html - 如何将 QuantitativeValue 添加到产品而不是报价中?

html - 您可以在 schema.org 标记中使用纯文本作为地址吗?

javascript - 带有响应式 HTML5 视频的 Bootstrap 轮播?

javascript - HTML 按钮的 "onclick"属性在单击之前调用函数

css - 使用 CSS 隐藏 'aggregateRating'

schema.org - 'aggregateRating' 和 'review' 用于没有任何评级或评论的产品

html - 首页丰富网页摘要