有没有办法将标记作为schema.org itemprop的值?

时间:2016-11-17 04:48:44

标签: html seo schema.org microdata structured-data

有没有办法将标记作为schema.org itemprop节点的值?例如。这有效:

<div itemscope itemtype ="http://schema.org/Movie">
  <h1 itemprop="name">Avatar</h1>
  <span>Director: <span itemprop="director">James Cameron</span> (born August 16, 1954)</span>
  <span itemprop="genre">Science fiction</span>
  <a href="../movies/avatar-theatrical-trailer.html" itemprop="trailer">Trailer</a>
</div>

但是你可以做到这一点:

<div itemscope itemtype ="http://schema.org/Movie">
  <h1 itemprop="name">Avatar</h1>
  <span>Director: <span itemprop="director">James Cameron</span> (born August 16, 1954)</span>
  <span itemprop="genre"> <p>Science</p> <h2>fiction</h2></span>      <<====
  <a href="../movies/avatar-theatrical-trailer.html" itemprop="trailer">Trailer</a>
</div>

1 个答案:

答案 0 :(得分:2)

HTML规范defines what the property value is of an element with an itemscope attribute,它表示除metaaudioembediframeimg,{之外的其他元素{1}},sourcetrackvideoaarealinkobject,{{1 }},或data,“值是元素的textContent ”。

因此,HTML规范要求微数据标记的使用者忽略metertime元素内的标记,并使用该文本。