HTML5 标头层次结构
我有一个关于使用 HTML5 时的标题层次结构(尤其是部分)的快速问题。我是从SEO的角度来问的。
此时我的标记如下所示:
<article>
<header><h1>Article Header</h1></header>
<!-- Bla bla -->
<section>
<header><h1>Article section 1</h1></header>
<!-- Bla bla -->
</section>
<section>
<header><h1>Article section 2</h1></header>
<!-- Bla bla -->
<h2>Article section 2 Sub 1</h2>
<!-- Bla bla -->
</section>
<section>
<header><h1>Article section 3</h1></header>
<!-- Bla bla -->
</section>
</article>
我要问的问题是关于
和 文章第 2 部分
文章部分 3
< /code> 以及中间的代码。
其大纲符合预期:
hmtl5 大纲 http://i51.tinypic.com/34pi1hk.jpg
正如您在第二张图片中所看到的,似乎
Article section 2 Sub 1
被赋予了更多“重要性”,尽管它只是一个 h2
另一小节(就像大纲中显示的那样)。
现在我想知道我是否可以安全地忽略这一点,或者 Google 是否也可能认为
比上一个和下一个 Article section 2 Sub 1
h1 更重要标题?显然,我想确保
Article section 2 Sub 1
的重要性低于上一个和下一个 h1
标题。
我希望我能够解释我想要弄清楚的事情!
I have got just a quick question regarding the header hierarchy when using HTML5 and especially sections. I am asking from a SEO point of view.
At this moment my markup looks like this:
<article>
<header><h1>Article Header</h1></header>
<!-- Bla bla -->
<section>
<header><h1>Article section 1</h1></header>
<!-- Bla bla -->
</section>
<section>
<header><h1>Article section 2</h1></header>
<!-- Bla bla -->
<h2>Article section 2 Sub 1</h2>
<!-- Bla bla -->
</section>
<section>
<header><h1>Article section 3</h1></header>
<!-- Bla bla -->
</section>
</article>
The questions I am asking is about <h1>Article section 2</h1>
and <h1>Article section 3</h1>
and the code in-between.
Its outline is as expected:
hmtl5 outline http://i51.tinypic.com/34pi1hk.jpg
But when looking at the site without css, I am seeing this:
As you can see in the second picture it seems that <h2>Article section 2 Sub 1</h2>
is given more "importance", although it is just a h2
of another subsection (just like displayed in the outline).
Now I am wondering if I can safely ignore this, or does Google probably also think that <h2>Article section 2 Sub 1</h2>
is more important than the previous and next h1
titles? Obviously, I want to make sure that <h2>Article section 2 Sub 1</h2>
is given less importance than the previous and next h1
titles.
I hope I was able to explain what I am trying to figure out!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
就 SEO 而言,呈现页面的顺序没有任何意义。在 h1 所处的上下文中,与 h2 相比,h1 始终会被赋予更高的重要性。
The order of rendering the page never means anything as far as SEO is concerned. h1 will always be given more importance compared to h2 in the context it is placed in.
首先,HTML5向后兼容HTML4。
,或者两者都使用!但默认样式首先是为了保持与旧页面的向后兼容性,
然后实现html5-sectioning的默认样式
我对此非常确定,因为我读过一些关于 mozilla 的 bugzilla 的讨论
希望这会有所帮助!
Firstly, HTML5 is backward-compatible with HTML4.
but default style is firstly made to maintain backward compatibility with older pages,
then to implement html5-sectioning's default style
I'm pretty sure about this because I've read some discussions on mozilla's bugzilla
Hope this helps!