【发布时间】:2014-10-15 08:40:31
【问题描述】:
考虑一下这个 HTML:
<header>
<div id="logo" itemscope itemtype="http://schema.org/Organization">
<a itemprop="url" href="//www.seashellswebsite.co.uk/">
<img itemprop="logo" src="logo.gif" alt="Seaside Shells" title="Seaside Shells">
</a>
<meta itemprop="name" content="Seaside Shells">
<meta itemprop="legalName" content="Seaside Shells Ltd">
<meta itemscope itemprop="address" itemtype="http://schema.org/PostalAddress" itemref="schemaOrganizationAddress">
<meta itemprop="description" content="We sell sea shells on the sea shore. The sea shells we sell are unfortunately rather overpriced.">
</div>
</header>
<h1>Super Interesting Page</h1>
<p>Foo bar.</p>
<footer>
<span id="schemaOrganizationAddress">
<span itemprop="streetAddress">1 Seafront Road</span>,
<span itemprop="addressLocality">Fishing Town</span>,
<span itemprop="addressRegion">Coastal County</span>,
<span itemprop="postalCode">12345</span>
</span>
</footer>
W3C 验证器这样抱怨:
元素
meta缺少必需的属性content。
… 并且指的是这一行:
<meta itemscope itemprop="address" itemtype="http://schema.org/PostalAddress" itemref="schemaOrganizationAddress">
但是content 属性应该在这里,因为itemref 属性表明内容驻留在当前范围之外的另一个元素中?在这种情况下,content 属性肯定超出了要求吗?
【问题讨论】:
-
注意:微数据定义when it is allowed to have
metainbody:content属性必须存在。
标签: html w3c-validation microdata