【发布时间】:2016-03-18 11:18:20
【问题描述】:
<!DOCTYPE html>
<html itemscope itemtype="http://schema.org/WebSite">
<head>
<meta itemprop="creator" itemscope itemref="mdFoo">
</head>
<body>
<div id="mdFoo" itemscope itemtype="http://schema.org/LocalBusiness">
<meta itemprop="name" content="Foo comp">
<meta itemprop="telephone" content="0">
<meta itemprop="legalName" content="Foo comp Ltd">
<meta itemprop="url" content="http://www.foo.com">
<meta itemprop="email" content="info@foo.com">
<div itemprop="address" itemscope itemtype="http://schema.org/PostalAddress">
<meta itemprop="streetAddress" content="mystreet">
<meta itemprop="postalCode" content="1233">
<meta itemprop="addressLocality" content="London">
<meta itemprop="addressCountry" content="UK">
</div>
</div>
</body>
</html>
当使用 Google (https://google.com/webmasters/markup-tester/) 进行验证时:“WebSite 不是有效类型。”
使用 https://validator.nu/ 会给我“元素元缺少必需的属性内容”。
关于如何解决此问题的任何建议?
【问题讨论】:
-
首先用
/>终止您的meta标签。 -
为什么? 也是正确的。这不是必需的,对于
也是如此。它是 html5 而不是 xhtml...见:w3schools.com/tags/tag_meta.asp
-
请注意,您已链接到 Google 的电子邮件测试工具。你可能想要的测试工具是developers.google.com/structured-data/testing-tool
标签: html schema.org microdata