微数据面包屑的 HTML5 验证
我试图让我的页面进行验证,它现在抛出的唯一错误是:
此时元素 a 上不允许属性 itemprop 。
我的代码如下:
<div itemscope itemtype="http://data-vocabulary.org/Breadcrumb">
<a href="http://www.example.com/dresses" itemprop="url">
<span itemprop="title">Dresses</span>
</a>
</div>
这遵循 Google 在以下页面上提供的电子邮件:
这里似乎也遵循 HTML5 微数据规范:
有什么想法为什么这不能验证吗?我错过了什么,或者这对于验证者目前无法验证来说太新了?
I'm trying to get my pages to validate and the only error it is now throwing is:
Attribute itemprop not allowed on element a at this point.
My code is as follows:
<div itemscope itemtype="http://data-vocabulary.org/Breadcrumb">
<a href="http://www.example.com/dresses" itemprop="url">
<span itemprop="title">Dresses</span>
</a>
</div>
This follows the email given by Google on the following page:
It also seems to follows the HTML5 Microdata specification as well here:
Any ideas why this doesn't validate? What am I missing or is this just too new to for the validator to validate at the moment?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
要让面包屑显示在 SERP 中,请像这样编码您的 schema.org 标记。请注意 div 嵌套和“child”属性:
这在 Google 结构化数据测试工具中进行验证:
http:// /www.google.com/webmasters/tools/richsnippets
许多关于面包屑 schema.org 标记的文档都非常不正确。有一些关于此的线索。以上是我的工作解决方案,希望对您有所帮助。
To get breadcrumbs to show in SERPs, code your schema.org markup like this this. Notice the div nesting and the "child" property:
This validates in Google Structured Data Testing Tool:
http://www.google.com/webmasters/tools/richsnippets
A lot of the documentation on schema.org markup for breadcrumbs is widely incorrect. There are a couple thread out there about this. Above is my working solution, hope it helps.
您使用的是哪个验证器?有些尚不支持 HTML5 的最新功能,有些则支持,但由于您声明的文档类型而不会触发对文档的正确验证。
不过,新发布的Nu验证器应该不会出现这些问题。您可以在 .net 杂志上阅读相关内容。
Which validator were you using? Some don't support the newest features of HTML5 yet, and some do but won't trigger proper validation for your document because of the doctype that you declare.
However, the newly released Nu validator shouldn't have these problems. You can read about it on .net magazine.
schema.org 已取代 data-vocabulary.org。 Schema.org 架构得到主要搜索引擎的认可。 Schema.org 的架构中没有 itemprop=url 。因此,可能是 Google 的工具或其搜索引擎机器人已停止遵循 data-vocabulary.org 模式。无论如何,最好转向 Schema.org 面包屑。
项目类型 - 网页是网页的默认类型。因此,即使您不提供 itemtype - WebPage 并提供 BreadCrumb 类型,那么 Google 也会将其理解为面包屑。我在 Schema.org 页面上读到了这篇文章。我已经给了你这个链接。
使用此 Google 的工具进行验证。
schema.org has come in place of data-vocabulary.org. Schema.org schema is agreed upon by major search engines. And Schema.org does not have itemprop=url in its schema. So, may be Google's tool or its search engine robot has stopped following data-vocabulary.org schema. Anyway better shift to Schema.org Breadcrumb.
Itemtype - WebPage is default for a web page. So, even if you do not provide itemtype - WebPage and provide BreadCrumb type then Google will understand it as breadcrumb. I read this in Schema.org page. I have given you link for this.
Use this Google's tool for validation.
这会将有关面包屑的许多数据暴露给爬虫。如果您将列表项设为内联,则输出将如下所示:
1.Home > 2.类别> 3.子类别
This will expose many data regarding the breadcrumb to the crawler. If you make the list items inline, the output will be as follows:
1.Home > 2.Category > 3.SubCategory