Skip to content

Why Is My Section With a Heading Not a Region Landmark?

admin10 min read
Illustration of a section with heading not a region landmark until it receives a name tag

A section with heading not a region landmark is expected behavior, not a bug. A visible h2 describes the content, but it does not automatically become the accessible name of the section that contains it. As checked on November 19, 2026, the ARIA in HTML specification gives a section the region role only when it has an accessible name. Without a name, its implicit role is generic, and the heading inside it is still a heading.

The fix is to name the section by pointing aria-labelledby at the heading’s id, and to do that only for areas that deserve a landmark. You can edit and compare both versions in the HTML Code Editor, which gives you a sandboxed live preview. That preview shows what the page looks like, not what role the section has, so I also cover how to verify the result.

Conceptual illustration showing a heading marker and a separate name tag above a content block

Why a section with heading not a region landmark is the default

Two separate structures are at work here. A heading creates an outline entry that people can jump between with heading navigation. A landmark role creates a named area that people can jump between with landmark navigation. Putting an h2 inside a section only does the first job.

The WHATWG HTML Standard describes the section element as a thematic grouping of content, typically with a heading. It does not say that every section must be exposed as a landmark. The ARIA in HTML specification adds the condition: a section maps to region when it has an accessible name, and to generic when it does not.

An accessible name is the text that the browser exposes in its accessibility tree for an element. It is computed from sources such as aria-labelledby, aria-label, or, for some elements, their own content. For a section, the heading text inside it is not one of those sources unless you point to it explicitly.

MarkupRole of the sectionRole of the heading
Heading inside, no naming attributegenericheading
aria-labelledby pointing at the headingregionheading
aria-label with a non-empty valueregionheading, if one exists

Notice that the heading column never changes. Naming the section does not alter the heading, and leaving the section unnamed does not break the heading. If your real problem is the outline itself, such as subheadings that look right but have heading levels out of order, that is a different fix and a region will not solve it.

Compare an ordinary headed section with a named region

Start with the markup most people write. This section has a visible heading and nothing else that names it.

<section>
  <h2>Delivery details</h2>
  <p>Orders ship within three business days.</p>
</section>

Here the section is generic. It still groups the content and the heading still appears in the heading outline, which is often all a subsection needs.

Now the named version. The heading gets an id, and the section references that id with aria-labelledby.

<section aria-labelledby="delivery-heading">
  <h2 id="delivery-heading">Delivery details</h2>
  <p>Orders ship within three business days.</p>
</section>

Visually, the two examples are identical. The difference is only in the accessibility tree, where the second section now has an accessible name taken from the heading text, so its implicit role is region.

Two tempting shortcuts do not do the job. Adding an id to the heading alone gives you a link target and nothing else, because nothing references it. Adding role="region" to the section is not the recommended fix either, since the native element already maps to region once it has a name, and the attribute does not supply the name.

A thread tying a title card to a content panel, illustrating an aria-labelledby reference

Name the section with aria-labelledby, or aria-label as a fallback

The pairing between the attribute and the heading is the whole technique, so check these details each time:

  • The value of aria-labelledby must match the heading’s id exactly, including letter case.
  • Every id on the page must be unique. A duplicate means the reference can resolve to the wrong element.
  • The attribute goes on the section, and the id goes on the heading inside it.
  • If the referenced id does not exist, do not expect a name from it. Treat that as a broken reference and fix it.

Referencing visible text is usually the best choice because the name and the heading cannot drift apart when someone edits the heading later. When an important area has no suitable visible heading, aria-label can supply the name instead.

<section aria-label="Shipping summary">
  <p>Free returns for 30 days.</p>
</section>

Keep names short and specific, and avoid repeating the word “region” in them. The role is already conveyed separately, so “Shipping summary” is better than “Shipping summary region”.

If you are building this in a visual editor, be aware that attributes can be lost. The homepage WYSIWYG editor is a Quill rich-text editor that removes markup it does not support, so I would write this structure in the code editor instead. I also cover a case where WYSIWYG source view removes class and id attributes, which is exactly the kind of loss that would break an aria-labelledby reference.

When a region landmark helps and when an ordinary section is enough

A landmark is a shortcut. Assistive technology users can list or jump between landmarks to move around a page quickly. That is valuable when the landmark marks an area a person would plausibly want to reach directly, and it is noise when every block of content claims the same status.

Before reaching for region, check whether a more specific landmark fits. The main content, a navigation block and complementary content each have their own native element, and those are better choices than a generic named region. Use a named region for significant areas that do not fit those roles.

Good candidates are areas such as an order summary on a checkout page, a pricing comparison block, or a help and contact panel. Poor candidates include each question in an FAQ, each card in a grid, and every subsection of a long article. Those can stay as ordinary sections with ordinary headings.

<main>
  <h1>Checkout</h1>
  <section aria-labelledby="order-summary-heading">
    <h2 id="order-summary-heading">Order summary</h2>
    <p>Two items, free standard delivery.</p>
  </section>
  <section>
    <h2>Gift options</h2>
    <p>Add a message to your parcel.</p>
  </section>
</main>

In this example, only the order summary is a named region. The gift options block is a normal headed section, and nothing is lost by leaving it that way.

If a page does have several regions, give each one a distinct, meaningful name. Two regions both called “Details” make landmark navigation harder to use. WAI guidance notes that landmarks lose value as their number grows, and it suggests keeping them to around seven or fewer. Treat that as a rule of thumb, not a requirement or a measured limit.

Fix a section with heading not a region landmark in the HTML Code Editor

The HTML Code Editor gives you syntax highlighting, auto-closing tags, a sandboxed live preview, and beautify or minify actions. It has no validation, so it will not warn you about a mismatched id or a duplicate one. Work through the change like this:

  1. Paste or type the section you want to inspect. Use the unnamed example above if you are practicing.
  2. Decide whether the area deserves a landmark. If it is only a subsection of the surrounding content, stop here and leave it as it is.
  3. Add a unique id to the heading, for example order-summary-heading.
  4. Add aria-labelledby to the section with the same value.
  5. Look at the live preview. It should look exactly the same as before, which is the expected result because the change is not visual.
  6. Search your full page source for the new id and confirm it appears only once as an id.

If the markup has become hard to read after edits, the HTML Beautifier can re-indent it. A beautifier only improves layout. It does not repair invalid markup, and it cannot tell you whether your naming is correct.

Keep the original markup somewhere before you minify anything. Minification is about file size and has nothing to do with this fix, so there is no reason to run it while you are checking structure.

Verify the result and know the limits

Several checks are involved, and each answers a different question. Syntax tells you the markup parses. Reference checks tell you the id and aria-labelledby values match. The accessibility tree tells you what role and name the browser actually computed. Assistive-technology testing tells you whether the page is usable. A good-looking preview proves none of these by itself.

To confirm the role and name, load the real rendered page and inspect the section in your browser’s developer tools accessibility view. Look for a role of region and a name that matches the heading text. Then, if the page matters, test landmark and heading navigation with the assistive technologies your audience uses, in the actual page context.

I will not claim that a particular browser and screen reader pair announces this example in a particular way, because that depends on the combination and I have not tested every one. This guide also makes no browser-version compatibility claim.

The sandboxed preview in an editor is also not the same environment as your site. Layout can differ, as in the case where the HTML editor preview media query uses iframe width instead of the browser window. Scripts, templates and other markup on your real page can also change ids or insert extra landmarks, so always check the final output, not just the snippet.

Frequently asked questions

Does a heading inside a section make it a region landmark?

No. The heading stays a heading, but it does not name the section. A section element has the implicit role region only when it has an accessible name. Otherwise its role is generic.

Should I add role="region" to fix it?

That is not the recommended fix. A named section already maps to region, and the attribute does not supply the missing name. Name the section with aria-labelledby or aria-label instead.

Is aria-labelledby or aria-label better?

Prefer aria-labelledby when a suitable visible heading exists, because the name stays in sync with the text people can see. Use aria-label when an important area has no good visible heading to reference.

Should every section have aria-labelledby?

No. Reserve named regions for significant areas users would benefit from finding through landmark navigation, especially when no more specific landmark fits. Ordinary headed subsections can remain ordinary sections.

How many region landmarks are too many?

There is no fixed limit. WAI guidance says landmarks lose value as their number grows and suggests seven or fewer as a rule of thumb. Judge by whether each region helps someone find something.

Is an unnamed section harmful to accessibility?

Not by itself. It is a generic grouping, and the heading inside it still works for heading navigation. It only lacks landmark status, which is often what you want for a subsection.

How do I check the role and name of my section?

Inspect the section in your browser’s developer tools accessibility view on the rendered page and look for the role and name. Then test navigation with relevant assistive technologies. An editor preview is not an accessibility audit.

Next steps

A section with heading not a region landmark is usually the correct, intended result. The heading describes the content, but only an accessible name turns the section into a region. Add a matching id and aria-labelledby to the few areas people would want to jump to, use aria-label when no visible heading fits, and leave ordinary subsections alone. As a next step, open your page in the HTML Code Editor, mark at most a handful of key areas, then confirm the role and name in your browser’s accessibility tree on the rendered page.

Related tools and resources on HTML Editor Online:

Sources and further reading

Try it in your browser

Free online editors with syntax highlighting. Open one and start coding, no account needed.

All Tools