The <h> Element

Just kidding, don't use this element. It doesn't exist, but it should. TimBL thought so in 1991, and I still think it should exist, but it doesn't. As he said:

I would in fact prefer, instead of <H1>, <H2> etc for headings [those come from the AAP DTD] to have a nestable <SECTION>..</SECTION> element, and a generic <H>..</H> which at any level within the sections would produce the required level of heading.

The headingoffset attribute

Note: This is currently experimental and under development. You can check out the polyfill and give feedback.

When placed on a container element, the headingoffset attribute adjusts the aria-level of headings inside, allowing internal contents to be written independently. This is useful for helping stitch together content that is written as independent document fragments and with simple, existing authoring tools. Nested containers add levels.

Example 1

<h1>I’m a level-1 heading!</h1>
<h2>I’m a level-2 heading!</h2>

<div headingoffset="1">
  <h1>I’m a level-2 heading!</h1>
  <h2>I’m a level-3 heading!</h2>
</div>

The practical upshot of this would give authors the ability to write content almost like Tim intended, by using headingoffset="1" on containers, and always using <h1> instead of his originally proposed <h>


<h1>I’m a level-1 heading!</h1>	    	
<section headingoffset="1">
  <h1>I’m a level-2 heading!</h1>
    <section headingoffset="1">
      <h1>I’m a level-3 heading!</h1>
    </section>
  </section>
</section>