Knowledge baseExam Center
ENEnglish
Choose language13

CKTIS / HTML

headingreset — a boundary for heading offset computation

The boolean headingreset attribute stops headingoffset accumulation from more distant ancestors. It does not discard the offset on the element carrying headingreset itself.

Version: WHATWG HTML Living Standard; index snapshot date recorded separately

Syntax

headingreset | headingreset="" | headingreset="headingreset"

headingreset stops traversal to more distant ancestors when computing a heading's offset. Computation starts at the heading itself. Any headingoffset values below the boundary and on the element carrying headingreset still count; this does not unconditionally set the level to 1.

This is a boolean attribute: presence enables its behavior, and absence disables it. Valid forms include headingreset, headingreset="", and headingreset="headingreset". Writing headingreset="false" is invalid and does not disable the behavior — remove the attribute instead.

In the example, the expected semantic levels are 1, 2, 2. Removing headingreset changes the last level to 3. This follows the standard's algorithm, rather than measuring browser support; verify behavior in your target environment before deployment.

Examples

<!doctype html>
<html lang="en">
<meta charset="utf-8">
<title>Heading reset example</title>
<body>
  <h1>Guide</h1>
  <div headingoffset="1">
    <h1>Chapter</h1>
    <div headingreset headingoffset="1">
      <h1>Independent topic</h1>
    </div>
  </div>
</body>
</html>

Result

Guide: 1
Chapter: 2
Independent topic: 2

The displayed code and declared result were verified in an isolated environment using the method recorded in the verification evidence for this exact version.

Sources