只是看那里张贴的例子
Customer reviews: <div itemprop="reviews" itemscope itemtype="http://schema.org/Review"> <span itemprop="name">Not a happy camper</span> - by <span itemprop="author">Ellie</span>, <meta itemprop="datePublished" content="2011-04-01">April 1, 2011 <div itemprop="reviewRating" itemscope itemtype="http://schema.org/Rating"> <meta itemprop="worstRating" content = "1"> <span itemprop="ratingValue">1</span>/ <span itemprop="bestRating">5</span>stars </div> <span itemprop="description">The lamp burned out and now I have to replace it. </span> </div> <div itemprop="reviews" itemscope itemtype="http://schema.org/Review"> <span itemprop="name">Value purchase</span> - by <span itemprop="author">Lucas</span>, <meta itemprop="datePublished" content="2011-03-25">March 25, 2011 <div itemprop="reviewRating" itemscope itemtype="http://schema.org/Rating"> <meta itemprop="worstRating" content = "1"/> <span itemprop="ratingValue">4</span>/ <span itemprop="bestRating">5</span>stars </div> <span itemprop="description">Great microwave for the price. It is small and fits in my apartment.</span> </div>
如果您将meta标签保留在中<head>,那么如何将这两个日期与他们的评论相关联? <meta itemprop="datePublished" content="2011-04-01"> <meta itemprop="datePublished" content="2011-03-25">
<head>
<meta itemprop="datePublished" content="2011-04-01">
<meta itemprop="datePublished" content="2011-03-25">
这引起了混乱,我想知道如何正确进行。
如果一个meta元素
meta
itemprop
content
name
http-equiv
charset
那么将其包含meta在中是有效的body。(如果该值为URL,则必须link改用。)
body
link
为什么?因为微数据规范更改了HTML5。
(请注意,RDFa的也允许改变HTML5 meta在body某些情况下)。
如果您将meta标记保留在中<head>,那么如何将这两个日期与他们的评论联系起来?
您可以使用itemref属性:
itemref
<!DOCTYPE html> <html> <head> <title>Using itemref for meta in the head</title> <meta itemprop="datePublished" content="2011-03-25" id="date"> </head> <body> <div itemscope itemtype="http://schema.org/Review" itemref="date"> <span itemprop="name">…</span> </div> </body> </html>
itemref采用空格分隔的id值列表,因此您甚至可以引用两个或多个元素。只需将应添加到项目id的所有元素(包含itemprop属性)添加到其itemref属性,例如:itemref="dateauthor rating"。
id
itemref="dateauthor rating"