Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why are there only 6 <h> tags?

Tags:

html

This has been boggling my mind for a while. While writing code, I noticed that there are only 6 <h> tags, which are:

  • <h1>
  • <h2>
  • <h3>
  • <h4>
  • <h5>
  • <h6>

I would really like to know why there are only 6, and not, well, an infinite number!

PS. I'm sorry if this is not the correct place to ask this question. If it isn't, please point out to me where I should instead ask this question.

like image 219
Toby van Kempen Avatar asked Apr 17 '14 15:04

Toby van Kempen


1 Answers

HTML was written as an SGML application. Each element type had to be defined explicitly (DTDs provide no way to define element types with wild cards), so an infinite number could not be defined.

6 was presumably chosen because it was assumed that nobody would need a sub-sub-sub-sub-sub-sub-heading. Very few documents come close to that level of subdivision of sections.

The sectioning rules in HTML 5 effectively give an unlimited number of levels of headings, but tool support for the new sectioning algorithm is still weak.

like image 170
Quentin Avatar answered Sep 26 '22 03:09

Quentin