简体   繁体   English

如何正确使用H标签?

[英]How to use H tags correctly?

I'm looking at my template now, and I see a problem. 我正在看我的模板,发现一个问题。 Although, I'm not too advanced, so here I am, asking if I'm seeing a problem when there isn't one: 虽然,我不太先进,所以我在这里,问是否在没有人的情况下遇到问题:

Homepage contains: 主页包含:

15 H1 tags, one for each post header. 15个H1标签,每个帖子标题一个。

0 H2 tags. 0个H2标签。

3 H3 tags, for the widget titles. 3个H3标签,用于小部件标题。

8 H4 tags, for widget contents. 8个H4标签,用于小部件内容。

0 H5 tags. 0个H5标签。

0 H6 tags. 0个H6标签。

Same goes for a single page, except it contains 1 H1 tag. 除了包含1个H1标签之外,单个页面也是如此。

So I'm seeing a problem because there is no H2 tags, there is H3 and H4 tags, and then no H5 and H6 tags. 所以我看到一个问题,因为没有H2标签,没有H3和H4标签,然后没有H5和H6标签。

What I would for for your homepage : 我想要您的主页:

  • 1 H1 tags, title of the website. 1 H1标签,网站标题。
  • XX H2 tags, one for each post header. XX个H2标签,每个帖子标题一个。
  • XX H2 tags, for the widget titles. XX H2标签,用于小部件标题。
  • XX H2 tags, for widget contents. XX H2标签,用于小部件内容。

You have to use H3 for content directly related to the previous H2 in the page. 您必须将H3用于与页面中先前H2直接相关的内容。 The inferior title tags must used when a semantic relationship exists between, eg : 当之间存在语义关系时,必须使用下级标题标签,例如:

h1 : 10 cars I love
p : intro

h2 : Audi A5 (the first car)
p : some text about the audi

h3 : the speed of the A5
p : some text about the speed of the audi A5
h3 : another thing I love about the A5
p : text about this....

h2 : second car I love
same structure as the Audi A5 part

This way, you have a relationship between every title tags and the immediate following title level. 这样,您将在每个标题标签和紧随其后的标题级别之间建立关系。

For your homepage, the different titles seems totally unrelated, thus you should use H2 only for them. 对于您的主页,不同的标题似乎完全无关,因此,您仅应使用H2。

You should only have one h1 per HTML document. 每个HTML文档只应有一个h1。

But h2, h3, h4, h5 you can use at will. 但是您可以随意使用h2,h3,h4,h5。

But following a hierarchy. 但是遵循层次结构。 So, try to not skip a level. 因此,请尝试不要跳过某个级别。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM