正确使用Schema.org“ImageObject”

时间:2013-11-14 17:22:06

标签: html5 schema.org microdata

我怀疑正确使用架构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>

2 个答案:

答案 0 :(得分: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>

答案 1 :(得分:-1)

也许有人在搜索&#34;如何使用Schema.org ImageObject&#34;时会发现这个问题,因此,仅供参考,以下是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