【问题标题】:The itemprop attribute was specified, but the element is not a property of any item指定了 itemprop 属性,但该元素不是任何项目的属性
【发布时间】:2015-06-02 05:23:27
【问题描述】:

我不知道为什么,但我收到以下错误:

第 1 行,第 12604 列:指定了 itemprop 属性,但该元素不是任何项目的属性。

使用我在网页中使用过的代码:

<pre>
   <div itemscope="">
      <img height="270" width="270" itemprop="image" title="Ladies Ultra Cotton 100% Cotton T-Shirt - Gildan 2000L" alt="Ladies Ultra Cotton 100% Cotton T-Shirt - Gildan 2000L" src="http://www.outletshirts.com/31989-home_default/ladies-ultra-cotton-100-cotton-t-shirt.jpg" class="replace-2x img-responsive">
   </div>
</pre>

为什么会这样?

【问题讨论】:

  • outletshirts.com/31989-home_default/…" class="replace-2x img-responsive">
  • 把你的代码放在有问题的地方,而不是在评论中发布

标签: javascript jquery html w3c-validation


【解决方案1】:

您应该明确提供这些属性(名称、描述、图像)所属的类型。

在 Schema.org 中,一切都是事物。事物有许多子类型,列在“更具体的类型”下。从那里开始,为您的内容选择最具体的类型。

例如:网页、文章或 BlogPosting。

它可能看起来像(此处以网页为例):

<html itemscope itemtype="http://schema.org/WebPage">

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2015-05-21
    • 2015-12-05
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-05-18
    相关资源
    最近更新 更多