2012-02-29 43 views
0

我试图找到一种使用schema.org丰富网页中图像信息的方法。微数据:包括<span>作为<figure>的子项

下面的代码然而,似乎,没有通过审核:

 

<figure itemscope itemtype="http://schema.org/ImageObject" class="figure-container" style="width: 580px"> 
    <img itemprop="image" src="http://cdn.donaldjenkins.com/media/blog-posts/gtd-apps-1.jpg" alt="The Omnifocus Mac app" width="580" height="450" title="The Omnifocus Mac app"> 
    <figcaption itemprop="description"><span itemprop="name">The Omnifocus Mac app window</span>, showing the Perspectives settings panel. This is a powerful feature that allows you to conceal part of the app's inherent complexity when you want to. But Things allows you to do the same more easily with its 'Areas of responsibility' feature.</figcaption> 
</figure> 
 

包括<span>元素作为<figure>元素不验证的一个孩子,但我还没有发现的另一种方式将name属性附加到另一个标签,因为文本实际上并不需要格式化。

任何有关如何实现这一点的建议将受到欢迎。我也很难理解为什么<span>不能成为<figure>的孩子...

回答

2

尝试在http://validator.w3.org/nu/验证器,我复制/粘贴你的片段,它验证了很好。

+0

是的,你是对的。那么这是否意味着''毕竟可以是'

'的孩子? – 2012-03-01 00:46:04

+1

在HTML5中,如果您查看[

](http://www.whatwg.org/specs/web-apps/current-work/multipage/grouping-content.html#the-figcaption-element)元素,您将会看到内容模型是“流量内容”,没有任何限制。当你点击它时,你会看到一个标签列表。由于在该列表中,因此您可以使用它。如果您查看
的内容模型,您会发现它预计为
。 – linclark 2012-03-01 05:23:01

+0

Quod erat demonstrandum。谢谢! – 2012-03-01 15:00:58

相关问题