我应该使用多个 h1 还是不使用 h1 的多个 h2 ?
在一个显示导师列表的网页中,当前的 HTML 代码:
<div id="tutors">
<h1>Tutors</h1>
<div class="tutor">
<h2>John</h2>
<p>...</p>
</div>
<div class="tutor">
<h2>Mary</h2>
<p>...</p>
</div>
<div class="tutor">
<h2>David</h2>
<p>...</p>
</div>
</div>
现在,由于某些原因,需要在页面中删除当前由 h1 包裹的单词 Tutors。我能想到3个选择:
- 使用css来隐藏它。
- 只要去掉它,页面就会有h2 没有 h1。
- 删除它,并将所有 h2 更改为 h1。
哪一种更合适?
In a web page that shows a list of tutors, the current HTML codes:
<div id="tutors">
<h1>Tutors</h1>
<div class="tutor">
<h2>John</h2>
<p>...</p>
</div>
<div class="tutor">
<h2>Mary</h2>
<p>...</p>
</div>
<div class="tutor">
<h2>David</h2>
<p>...</p>
</div>
</div>
Now, for some reasons, the word Tutors which is currently wrapped by h1 needs to be removed in the page. I can think of 3 choices:
- Use css to hide it.
- Simply remove it, and the page will have h2
without h1. - Remove it, and change all h2 to h1.
Which one is more appropriate?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(6)
#3:删除它,并将所有 h2 更改为 h1。
,否则不能有
。
#3: Remove it, and change all h2 to h1.
<h2>
unless there's an<h1>
beforehand.根据页面的用例,其中任何三个听起来都是有效的选项。也就是说,在考虑这个问题时,我想到了一些事情:
Depending on the use case for the page, any three of those sound like valid options. That said, here are some things I thought about when considering this question:
没关系。
如果您使用 jQuery 来显示和隐藏内容,那么它对 SEO 没有影响。当您在所有实际意义上查看源代码时,搜索引擎会看到您所看到的内容。反正你也没有做什么偷偷摸摸的事情。
参考我关于堆栈溢出的帖子 如果我使用 Ajax 完成页面上的所有操作,我该如何进行搜索引擎优化?
因为您所做的是在搜索之后引擎已经出于所有实际目的考虑了它。
Doesn't matter.
If you are using jQuery to show and hide things it has no bearing on SEO. Search engines see what you see when you view source in all practical senses. You aren't doing anything sneaky anyway.
Reference my post here on stack overflow If I do everything on my page with Ajax, how can I do Search Engine Optimization?
because what you are doing is AFTER the search engines have looked at it for all practical purposes.
这些选项都不是好的 SEO。
这样的权重较大的标签被隐藏,则会损害您的排名。
没有
等)。此外,它们应始终按重要性降序排列。
并且它应该是第一个标题标签。就 SEO 权重而言,它们的顺序为
为什么这个标题首先需要隐藏?这似乎是对页面内容的一个很好的描述。
None of these options are good SEO.
<h1>
is hidden it will hurt your rank.<h3>
's without<h2>
's etc.). In addition they should always appear in decreasing order of importance.<h1>
and it should be the first heading tag. They are on the order of<title>
in terms of SEO weight.Why does this headline need to be hidden in the first place? It seems like a good description of the content of the page.
也许您应该考虑将这些项目格式化为定义列表,例如:
变为:
然后将 CSS 类和样式应用于元素,以便为有视力的用户美化它。只是一个想法。
Perhaps you should consider formatting these items as a definition list, e.g:
becomes:
And then apply CSS classes and styles to the elements to prettify it for sighted users. Just a thought.
这是一个偏好。您应该始终将演示文稿和结构分开,所以我想说只需将其注释掉,然后将其放在那里即可。如果你隐藏它,这实际上就不是演示,因为它永远不会被看到。所以3是最合适的。
This is a preference. You should always separate presentation and structure, so I would say just comment it out, and put that it use to be there. If you hide it, this really isn't presentation because it is never seen. So 3 would be the most appropriate.