正确使用HTML标题标签 [英] Proper use of HTML heading tags
问题描述
我无法理解HTML标题的正确用法。我使用书籍和在线资源进行自学,但在使用方法上略有差异。
[1]请注意 h1
标签仅用于一次,作为页面的主标题。 h2
至 h6 $ c $然而,它们应该总是按照它们的意图使用,例如,一个
h4
应该是一个子元素,标题 h3
,它应该是 h2
的子标题。
或
[2]逻辑标题级别反映了它与主要内容的重要性。
所以问题是:我是否按照 h4
必须是 h3
它应该是
h2
等的子标题,或者根据其与主要内容的重要性使用标题级别?
虽然,我看到两种方法都被使用。然而,第二种方法与文档大纲混淆。只是想获得一些其他意见。
如果您不遵守 order
或者多于1 h1
标签,但它肯定会看起来很丑。
遵循的第1点和第2点不是强制性的,但主要针对搜索引擎优化(seo)
。这是白帽SEO技术之一,这将有助于您的网页排名搜索引擎爬行。其次,你的网页应该更多语义正确
和更好看的大纲
。
I'm having trouble understanding the proper usage of HTML headings. I'm using books and online resources to self-learn but there are slight discrepancies on how to use them.
[1] "Note that the h1
tag is only used once, as the main heading of the page. h2
to h6
, however, can be used as often as desired, but they should always be used in order, as they were intended. For example, an h4
should be a sub-heading of an h3
, which should be a sub-heading of an h2
."
OR
[2] "the logical heading level reflects its importance in relation to the main content."
So the question is: do I use them in order where h4
must be a sub-heading of h3
which should be a sub-heading of h2
and so on or use the heading levels according to its importance in relation to the main content?
Although, I have seen both methods being used. However, the second method kind of messes with the document outline. Just want to get some other opinions on this.
Your webpage is not going to break if you don't follow the order
or have more than 1 h1
tags but it will definitely look ugly.
Following point 1 and point 2 that you mentioned is not mandatory but advisable mainly for search engine optimization(seo)
. It's one of the white hat seo techniques which will somewhat help in your web page ranking by a search engine crawler. Secondly, your webpage would be more semantically correct
and with a better looking outline
.
这篇关于正确使用HTML标题标签的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!