HTML headingoffset Global Attribute
The headingoffset attribute raises the level of the headings inside an element for assistive technology, without changing the heading tags. It is experimental.
Description
#enable-experimental-web-platform-features flag, and Firefox only behind a preference.The headingoffset global attribute raises the heading level of the headings inside the element, as exposed to assistive technologies, without changing which heading element is used. It makes it possible to reuse a piece of content, such as a component, an article preview or an embedded document, that starts with an <h1>, and still keep a correct outline in the page.
The value is a whole number from 0 to 8. To find the level of a heading, the browser adds up the headingoffset values of the heading and all its ancestors (also across shadow boundaries); an invalid value counts as 0, and the level never goes above 9. For example, an <h1> inside an element with headingoffset="1" that is inside another with headingoffset="2" has level 4. Levels 7 to 9 can only be reached this way or with aria-level.
<h1>Insect guide</h1> <!-- level 1 -->
<section headingoffset="1">
<h1>Appendix</h1> <!-- level 2 -->
</section>
The attribute does not change the element name, so CSS selectors such as h1 still match and the default styling does not change. An explicit aria-level takes precedence. Use headingreset to stop offsets from ancestors applying inside an element.
Syntax
<element headingoffset="number">
Values
- numberA whole number from 0 to 8 that is added to the level of the headings inside the element. Invalid values count as 0.
Example
Browser Support
The following information will show you the current browser support for the HTML headingoffset global attribute. Hover over a browser icon to see the version that first introduced support for this HTML global attribute.
Desktop





Tablets & Mobile





