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.
- 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
.
- 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.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…