- c - 在位数组中找到第一个零
- linux - Unix 显示有关匹配两种模式之一的文件的信息
- 正则表达式替换多个文件
- linux - 隐藏来自 xtrace 的命令
我正在尝试向我的网站添加一些丰富网页摘要,但在 AggregateRating 部分遇到了一些困难,因为我的 ratingValue 的值仅显示为图像。
我的标记如下所示:
<tr itemprop="reviews" itemscope itemtype="http://schema.org/Review">
<th>Rating:</th>
<td itemprop="aggregateRating" itemscope itemtype="http://schema.org/AggregateRating">
<img itemprop="ratingValue" class="rating" src="/content/images/ratings/4.5.png" alt="4.5" title="Rating: 4.5 / 5" />
</td>
</tr>
据我所知,这是有效的 HTML,因为文本值可作为 ALT 文本使用,因此符合可访问性指南。但是,我不确定如何将此 ALT 标记为 ratingValue 的值。
有人知道我应该在这里做什么吗?
谢谢。
好的,在使用 Google Rich Snippets Tester 数小时后,我得出的结论是:
<tr itemprop="reviews" itemscope itemtype="http://schema.org/Review">
<th>Rating:</th>
<td itemprop="aggregateRating" itemscope itemtype="http://schema.org/AggregateRating">
<meta itemprop="ratingValue" content="4.5">
<img class="rating" src="/content/images/ratings/4.5.png" alt="4.5" title="Rating: 4.5 / 5" />
</td>
</tr>
这似乎被正确地拾取了。
最佳答案
您的做法是正确的。只需在适当的位置添加一个标签并将值设置为“ratingValue”。它不会在页面呈现给用户时显示。
所以你会使用这个标签: <meta itemprop="ratingValue" content="4.5">
在http://schema.org/Review
范围内在您的文档中,就像您在更新中显示的那样。
关于html - 当值为图像时使用 AggregateRating 和 ratingValue,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6889256/
我正在为客户开发网站。他们用微数据标记了他们在网站上显示的个人评论,但没有包括相应的 aggregateRating 属性。 我已经通知他们,他们需要包含 aggregateRating 属性,以便让
我正在尝试向我的网站添加一些丰富网页摘要,但在 AggregateRating 部分遇到了一些困难,因为我的 ratingValue 的值仅显示为图像。 我的标记如下所示: Rating:
我正在向没有任何评级或评论的新产品页面添加 aggregateRating 和 review 属性。我如何将它们添加到我的页面并使它们对 Google 结构化数据有效? 我需
我正在使用 AggregateRating markup 将结构化数据实现到应用程序中.问题是当出现 0 个评级时,评级值是空的。使用 Google 结构化数据测试工具时出现以下错误。 Field r
来自 Schema.org 的丰富代码片段示例 http://schema.org/AggregateRating : Dell UltraSharp 30" LCD Monitor
我想将 AggregateRating 信息添加到我的网站,以便在 Google 的搜索结果中显示星星。 在 Google 的开发网站上,it says这仅适用于五种不同的评论类型: 本地企业 电影
我有以下结构化数据: { "@context": "https://schema.org/", "@type": "Offer", "priceCurrency": "EUR", "p
我是一名优秀的程序员,十分优秀!