Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Should h1 - h6 tags always be used sequentially, or are the numbers arbitrary?

Tags:

html

I am wondering whether the h1 - h6 tags should always be used sequentially (ie, always start with h1 and for each nested subheading use the adjacent hx tag), or whether as long as the order is correct it's ok (eg, starting at h2 and jumping straight to h4 is ok).

like image 312
Jamie Kitson Avatar asked Jan 24 '26 22:01

Jamie Kitson


1 Answers

The HTML5 spec says

4.3.10 Headings and sections

The h1h6 elements are headings.

The first element of heading content in an element of sectioning content represents the heading for that section. Subsequent headings of equal or higher rank start new (implied) sections, headings of lower rank start implied subsections that are part of the previous one. In both cases, the element represents the heading of the implied section. [...]

Sections may contain headings of any rank, and authors are strongly encouraged to use headings of the appropriate rank for the section's nesting level.

like image 98
Oriol Avatar answered Jan 26 '26 12:01

Oriol