A few days ago, I was rambling about style and semantic HTML. It was a post mostly about <kbd></kbd> tags, but toward the end I said this:

Reading through their tomb of standards, I realized I need to correct my headings on the blog too (I jump directly to <h3></h3> tags instead of going by order, because the CSS for these tags looks better — in other words, I’ve been lazy by not fixing this), among potentially many other things. There are over a hundred semantic tags in HTML, and there’s a reason for each one.

“Their tomb of standards” refers to the HTML Living Standard, and they (among other sources) explain why sub-headings in posts should actually be <h3></h3> tags (the way I’ve done it so far). Pretty simple when you think about it.

  1. The main header of the entire website is <h1> (in my case, “The Art of Not Asking Why”).
  2. Blog post headings are <h2> (as in the heading of this post, above).
  3. Blog post sub-headings are <h3>, as I was doing it.

This is not just a style and organizational thing; this is also how web browsers are programmed to read web pages, and they expect one <h1></h1> pair.

You’d notice I didn’t use the word “title” above, because in HTML the <title> is reserved for metadata in the head part of the page (defined by <head></head>). It’s there, and it serves a purpose — it’s basically your website’s name or the title of your entire web document (we need to remember, these things originated and were based back on what was printed on paper).

OK. I was wrong and order is restored. If I want to do sub-sub-headings, there’s <h4> for that. But if I get to that level of breaking down my posts, I think it’s a good sign that I’ve been writing too much in one go and should consider a smaller post.