2

我对模式 ImageObject 的正确使用有疑问。

我有一个小图像和一个以更大尺寸查看它的链接,但我不知道这三种形式中哪一种是正确的。

<span itemprop='image' itemscope itemtype='http://schema.org/ImageObject'>
<a href='big_1280x720.jpg' itemprop='contentUrl'><img src='small_90x60.jpg' itemprop='image'></a>
</span>

<span itemprop='image' itemscope itemtype='http://schema.org/ImageObject'>
<a href='big_1280x720.jpg' itemprop='image'><img src='small_90x60.jpg' itemprop='thumbnailUrl'></a>
</span>

<span itemprop='image' itemscope itemtype='http://schema.org/ImageObject'>
<a href='big_1280x720.jpg' itemprop='contentUrl'><img src='small_90x60.jpg' itemprop='thumbnailUrl'></a>
</span>
4

2 回答 2

6

删除第一次出现itemprop='image'的第三个是正确的。

<div itemscope itemtype='http://schema.org/ImageObject'>
  <a href='big_1280x720.jpg' itemprop='contentUrl'>
    <img src='small_90x60.jpg' itemprop='thumbnailUrl'>
  </a>
</div>
于 2013-11-16T03:41:09.710 回答
-1

也许有人在搜索“如何使用 Schema.org ImageObject”时发现了这个问题,就像我一样,所以,仅供参考,这里是 Schema.org 文档中的一个示例:

没有标记:

<h2>Beach in Mexico</h2>
<img src="mexico-beach.jpg" alt="Sunny, sandy beach."/>
By Jane Doe
Photographed in Puerto Vallarta, Mexico
Date uploaded: Jan 25, 2008
I took this picture while on vacation last year.

微数据:

<div itemscope itemtype="http://schema.org/ImageObject">
  <h2 itemprop="name">Beach in Mexico</h2>
  <img src="mexico-beach.jpg"
  alt="Sunny, sandy beach."
  itemprop="contentUrl" />
  By <span itemprop="author">Jane Doe</span>
  Photographed in
    <span itemprop="contentLocation">Puerto Vallarta, Mexico</span>
  Date uploaded:
    <meta itemprop="datePublished" content="2008-01-25">Jan 25, 2008
  <span itemprop="description">I took this picture while on vacation last year.</span>
</div>

http://schema.org/ImageObject#examples

于 2015-12-16T12:47:45.503 回答