html - 面包屑标记 - 主页和当前页面?

标签 html markup breadcrumbs rich-snippets

您是否应该为面包屑标记主页和当前页面?我使用数据词汇表只是因为 schema.org 不允许标记标题或 url - 只有一行没有分隔符的文本,除非手动添加。

这是我现在拥有的一个例子。请注意,我标记了主页和当前页面 - 这是正确的还是应该标记一个或两个?

<li itemscope itemtype="http://data-vocabulary.org/Breadcrumb"><a class="home" itemprop="url" href="/"><span itemprop="title"><img alt="Home" height="30" src="/images/trans.gif" width="16"></span></a></li>
<li itemscope itemtype="http://data-vocabulary.org/Breadcrumb"><a itemprop="url" href="/services/"><span itemprop="title">Services</a></span></li>
<li itemscope itemtype="http://data-vocabulary.org/Breadcrumb"><a itemprop="url" href="/service/widget/"><span itemprop="title">Widget</a></span></li>
<li itemscope itemtype="http://data-vocabulary.org/Breadcrumb"><a itemprop="url" href="/service/widget/features.htm"><span itemprop="title">Features</span></a></li>

最佳答案

我已经测试了以下似乎有效的方法,我认为您只有几个结尾 </span></a>标记错误。

<li itemscope itemtype="http://data-vocabulary.org/Breadcrumb"><a class="home" itemprop="url" href="/"><span itemprop="title"><img alt="Home" height="30" src="/images/trans.gif" width="16"></span></a></li>
<li itemscope itemtype="http://data-vocabulary.org/Breadcrumb"><a itemprop="url" href="/services/"><span itemprop="title">Services</span></a></li>
<li itemscope itemtype="http://data-vocabulary.org/Breadcrumb"><a itemprop="url" href="/service/widget/"><span itemprop="title">Widget</span></a></li>
<li itemscope itemtype="http://data-vocabulary.org/Breadcrumb"><a itemprop="url" href="/service/widget/features.htm"><span itemprop="title">Features</span></a></li>

您可能已经阅读过它,但您可以在此处阅读有关面包屑的更多信息:http://support.google.com/webmasters/bin/answer.py?hl=en&answer=185417 “微数据”链接就是一个很好的例子。

关于html - 面包屑标记 - 主页和当前页面?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15867675/

相关文章:

javascript - 当我尝试从网站的其他页面访问网页时,如何从缓存中获取网页并恢复表单中的数据?

html - 面包屑导航的正确 ARIA 处理

javascript - 如何在我的应用程序中循环图像

jquery - 如何获取div中所有下拉列表的所有选定值的数组

html - 如何实现长多行字符串的最后几个可见符号的淡入淡出?

javascript - HTML 5 UI 组件标记库(如 jQuery Mobile)

javascript - 有什么方法可以在 chrome 扩展中初始化一次吗?

html - IE 和非英文数字

validation - 如何将自定义 HTML 标签添加到 Visual Studio 并避免波浪线

CSS面包屑步骤指示器调整大小问题