← Back to release summary

Structured Headings, the headingoffset & headingreset attributes, and the :heading pseudo class

Category
DOM
Type
New or changed feature
Status
In development (Chrome In development)
Intent stage
None

Summary

A system for creating structured headings within a document. The `headingoffset=` attribute can be added to elements that influences the child `h1`-`h6` elements' heading levels, for example a `headingoffset=1` will mean all `h1` elements will have an effective heading level of 2, and so on. In addition the `:heading` pseudo class will select all headings (tags of `h1` to `h6`) and the `:heading(N)` pseudo class will select headings with an _effective_ level of `N`. This allows for documents with different heading structures (for example user generated content) to be combined to create a well defined heading structure without significantly altering the underlying documents.

Motivation

Websites which allow users to write comments or documents (User Generated Content - UGC) rely on users to produce meaningful heading structures for their written content. This can be difficult for a user where this content is presented on different surfaces (web pages or applications) that have different document structures. Giving web developers a headingstart attribute frees users from trying to pick the correct heading level (they can always start their comment or document at h1), and makes it significantly easier for web developers to render blocks of UGC without rewriting the UGC authors defined heading structures.

Standards & signals

View on chromestatus.com