# Overriding Heading Levels With the headingoffset HTML Attribute

DevFeed: [Overriding Heading Levels With the headingoffset HTML Attribute](<https://devfeed.tech/articles/overriding-heading-levels-with-the-headingoffset-html-attribute-112565.md>)

Original publisher: [Read original article](<https://blog.master.dev/overriding-heading-levels-with-the-headingoffset-html-attribute/>)

Author: Daniel Schwarz

Published: 2026-11-02T13:27:01Z

Content type: article

Language: en

Sources: [Master.dev Blog RSS Feed](<https://devfeed.tech/sources/master-dev-blog-rss-feed.md>)

Topics: [HTML](<https://devfeed.tech/topics/html.md>), [Web Accessibility (a11y)](<https://devfeed.tech/topics/web-accessibility.md>), [selectors](<https://devfeed.tech/topics/selectors.md>), [Front end](<https://devfeed.tech/topics/frontend.md>)

Tags: [accessibility](<https://devfeed.tech/tags/accessibility.md>), [algorithm](<https://devfeed.tech/tags/algorithm.md>), [aria](<https://devfeed.tech/tags/aria.md>), [blog-post](<https://devfeed.tech/tags/blog-post.md>), [component](<https://devfeed.tech/tags/component.md>), [containers](<https://devfeed.tech/tags/containers.md>), [css](<https://devfeed.tech/tags/css.md>), [devtools](<https://devfeed.tech/tags/devtools.md>), [dialog](<https://devfeed.tech/tags/dialog.md>), [h2](<https://devfeed.tech/tags/h2.md>), [hierarchy](<https://devfeed.tech/tags/hierarchy.md>), [html](<https://devfeed.tech/tags/html.md>), [math](<https://devfeed.tech/tags/math.md>), [style](<https://devfeed.tech/tags/style.md>)

## AI overview

The `headingoffset` attribute adds its integer value (0-8) to a heading's level, accumulating across ancestor elements and the heading itself; computed levels are capped at 9. `headingreset` cuts off inherited offsets, while an offset on the same reset element still applies. `aria-level` instead sets a heading's level directly and can also make a non-heading element a heading. For CSS that follows computed levels, the article recommends `:heading()` rather than element selectors such as `h3`. It advises using offsets and resets sparingly because distant or numerous offsets make hierarchy harder to track. At the time described, Firefox Nightly 153 had the feature behind a flag, and broad browser support was still lacking.

## Source excerpt

The new headingoffset HTML attribute lets you bump a heading's level up by adding to it, which is handy when a component's h1 needs to be an h2 somewhere else. Here's how the math works, how to reset it, how to style the result with :heading(), and where aria-level fits in.