验证器错误:
Warning: Consider using the h1 element as a top-level heading only (all h1 elements are treated as top-level headings by many screen readers and other tools).
From line 80, column 6; to line 80, column 29
80">↩ <h1 class = "pull-left"><a hre
导致错误的代码:
<h1 class = "pull-left"><a href="#" class="pull-left"><img src="images/logo.png" alt = "Logo"></a></h1>
有任何方法可以修复此验证程序错误吗?我尝试添加Text并使用css使其不可见,但它也使徽标图像也不可见。
答案 0 :(得分:1)
从SEO的角度来看,每页只有一个h1,因为h1旨在作为整个页面的顶级标题。搜索引擎查看h1以了解页面的内容,如果有多个h1,您可以停靠SEO点。正如错误所说,all h1 elements are treated as top-level headings by many screen readers and other tools
。
请参阅此主题:https://moz.com/community/q/how-will-it-effect-seo-to-have-multiple-h1-tags-on-a-page
用CSS隐藏它不会有帮助,因为验证器正在分析内容结构(HTML)。
这是一个通用的HTML问题,不限于Bootstrap。