Why are h1-h6 different tag names in HTML?

history, html

Solution

Why are h1 through h6 different tags in HTML, rather than having a syntax like `<heading level="1">`?

Because that's how they were originally defined in 1993:

Headings

   Six levels  of heading are supported. (Note that a hypertext node
   within a hypertext work tends to need less levels of  heading than
   a work whose only structure is given by the nesting of headings.)

   A heading element implies all the font changes, paragraph breaks
   before and after, and white space (for example) necessary to render
   the heading. Further character emphasis or paragraph marks are not
   required in HTML.

   H1 is the highest level of heading, and is recommended for the
   start of a hypertext node.   It is suggested that the the text of
   the first heading be suitable for a reader who is already browsing
   in related information, in contrast to the title tag which should
   identify the node in a wider context.

   The heading elements are

                <H1>, <H2>, <H3>, <H4>, <H5>, <H6>

You must also realize that there was minimal attribute usage in the original HTML spec. Each element served a specific purpose toward marking up documents with an emphasis on being easy to write and easy to read. I can only assume that a tag along the lines of `<heading>` would have been flat-out rejected because it would be too long to type, and would get in the way of the content of the page.

The usage predates any concept of external stylesheets, so selectors could not have played any role in the decision for the naming convention.

Once the elements were defined, there was no reason to rename them as it would cause backwards compatibility issues.

Problem

Why are `h1` through `h6` different tags in HTML, rather than having a syntax like `<heading level="1">`? I'd be interested to know the history behind the decision (and the same for the different lists, `ol` and `ul` rather than a common list). So far, my research hasn't turned anything up. The W3C Spec actually groups them all as "Headings", describing them jointly. Someone asked a similar question on Stack Overflow once before, but that discussion was about the value of semantics and not the reasoning for this particular language design choice. EDIT: I'm not asking about the SEO implications of one or the other, I'm looking specifically for answers around why the creators of HTML chose the syntax they did. EDIT 2: This question can elicit a lot of opinion but there exists a factual answer, and it was found by Jukka in the comments below: http://infomesh.net/html/history/early/. I assumed the opinion part of this discussion was had when HTML was first created, and was looking for that rather than trying to rehash that debate.

Original source