Counting With HTML5. Should H1, H2, H3, H4, H5 And H6 Be ...

Counting with HTML5
HTML5 includes several new elements that help the developer structure an HTML document in a more formal way: headers, footers, sections, articles… However, these elements do not include a number that refers to their importance in the HTML document, contrary to the heading tags (h1, h2, h3, h4, h5 and h6). Should this notation be reviewed?

The other day I was teaching how to specify headings with HTML, so I introduced the students to the h1, h2, h3, h4, h5 and h6 tags. The students quickly understood that the numbers (1 to 6) do not refer to the order of appearance nor the size of the headings. It was easy for me to show them  that the numbers refer to the header importance: related to their levels in the hierarchical structure of the document.

Some days later, I introduced them to the new HTML5 tags that give semantic meaning to sections of a typical web page or application, such as sections (the section tag), articles (the article tag), headers (the header tag) and footers (the footer tag). These elements can be nested in different ways, so for example, a section may contain several articles, and an article may contain several sections.

While we were coding an example, one of my students asked me about the headings. So, the student started specifying the different headings (h1, h2 and so on). Then, the student asked me about the sections: “So now, I have to include the section1 and section2 tags, right?” “Ehhhh, no”, I had to say. “Sections are sections (with the section tag) everywhere; their tags do not include a number to refer to their level in the hierarchical structure of the document”.

Of course, that situation made me think again about a suspicion that I already had in mind:

Do we still need six different tags to specify HTML headings?

Headers and footers can be nested in a page, section, or article. A section can be composed of different articles, while articles may contain several sections and subsections… There are a lot of possible combinations that will dictate the hierarchical structure of the document, and, do we have to specify the importance or level in that hierarchical structure in the headings and only in the headings? Why not in the sections themselves? Or in any other element?

Or are these numbers really needed? Could they be inferred from the structure of a coherent and well-formed HTML document? I mean, at least, it is sure that we can give headings different formats (with CSS) depending on where they are placed: inside of a header of an article, inside of a header of a section, inside of a section of a section, etc…

So, what do you think?

Author: Eduardo Rivera

  • International Universities in Spain
  • Study in Spain in English
  • Study Abroad in Spain

Từ khóa » H1 Vs H4 Html