正确使用Schema.org"ImageObject"

Enr*_*que 2 html5 microdata schema.org

我怀疑正确使用架构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>
Run Code Online (Sandbox Code Playgroud)

mar*_*nuy 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>
Run Code Online (Sandbox Code Playgroud)

  • 如果图像是较大范围的一部分(例如电影),则删除`itemprop ="image"`将其从当前范围提取到根范围.检查https://developers.google.com/structured-data/testing-tool/ (2认同)