html5 微数据与其他新语义元素混合。这是正确的吗?
我正在为餐厅评论编写标记。这就是我到目前为止所得到的:
<article itemscope itemtype="http://data-vocabulary.org/Review">
<img src="" alt="Shatranj Napoli" />
<h3 itemprop="itemreviewed">
<a href="">
<strong>Shatranj Napoli </strong>
<em>Bandra West</em>
</a>
</h3>
<p class="cuisine">Italian & Lucknowi</p>
<p itemprop="summary">Whoa! What a marriage of cuisines! Italian and Lucknowi. And much to my surprise, both are good, though I prefer...</p>
<span itemprop="rating">4.5</span>
<span class="price-rating">3.5</spam>
</article>
这看起来正确吗?或者这根本不起作用?
I am writing markup for a restaurant review. This is what I’ve got so far:
<article itemscope itemtype="http://data-vocabulary.org/Review">
<img src="" alt="Shatranj Napoli" />
<h3 itemprop="itemreviewed">
<a href="">
<strong>Shatranj Napoli </strong>
<em>Bandra West</em>
</a>
</h3>
<p class="cuisine">Italian & Lucknowi</p>
<p itemprop="summary">Whoa! What a marriage of cuisines! Italian and Lucknowi. And much to my surprise, both are good, though I prefer...</p>
<span itemprop="rating">4.5</span>
<span class="price-rating">3.5</spam>
</article>
Does this look right? Or will this not work at all?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
根据 Google 文档。
我认为您使用
标签不会导致任何问题,至少就微数据而言 - 请参阅 http://diveintohtml5.ep.io/extensibility.html#data-model,其中示例中使用了
。
Looks fine to me, as per Google’s documentation.
I don’t think the fact that you’re using the
<article>
tag will cause any problems, at least as far as the microdata goes — see e.g. http://diveintohtml5.ep.io/extensibility.html#data-model, where<section>
is used in the example.