指定了itemprop属性,但该元素不是任何项的属性

The itemprop attribute was specified, but the element is not a property of any item

本文关键字:属性 元素 任何项 itemprop      更新时间:2023-09-26

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

第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>

为什么会这样?

您应该显式地提供这些属性(名称,描述,图像)所属的类型。

在Schema.org中,一切都是Thing。Thing有很多子类型,列在"更具体的类型"下面。从这里开始,为你的内容选择最具体的类型。

例如:网页、文章或博客。

它可以看起来像(这里以网页为例):

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