STR-003 Give each view one h1 and every other heading the level its place in the outline gives it
- Level
- Guideline, our choice
- Verdict
- Insufficient evidence (1 of 3 judges spoke)
- Area
- Page structure
- Status
- proposed, version 1.0.0
Rule
Give each view one h1 that names its main content. Give every other heading the level its place in the outline gives it: one below the heading it belongs under. Going down never skips a level; going back up may skip as many as needed.
Examples
Live examples built with Justified's components. Try them with the mouse, the keyboard or a screen reader.
Do: One h1, one level at a time
Page: Project settings
h1Project settingsh2Membersh3Pending invitationsh3Current membersh4Adminsh2Billing addressBack up from h4 to h2 is fine.
Simulated: the heading list a screen reader would build from this page's code:
h1Project settingsh2Membersh3Pending invitationsh3Current membersh4Adminsh2Billing address
Check: one h1, no skipped levels.
Don't: A level is skipped
Page: Project settings
h1Project settingsh2Membersh4Pending invitationsh2Billing addressSimulated: the heading list a screen reader would build from this page's code:
h1Project settingsh2Membersh4Pending invitationsh2Billing address
Check: h2 is followed by h4, so h3 is skipped.
h4 straight under an h2. The gap in the list is what makes a person wonder what they missed.Don't: An h1 in the shell and one in the view
Page: Project settings, in the app shell
h1RidgewayThe shared layout's header
h1Project settingsh2MembersSimulated: the heading list a screen reader would build from this page's code:
h1Ridgewayh1Project settingsh2Members
Check: 2 h1s.
h1 and each view adds its own. "Jump to the h1" has two answers and neither is clearly the main content.Don't: A view with no h1
Page: Project settings
The header shows a logo
h2Project settingsh3MembersSimulated: the heading list a screen reader would build from this page's code:
h2Project settingsh3Members
Check: No h1.
h2, as when its title is a card title. There is no one place to begin.Do: Written Markdown sits below the h1
Page: Spring launch
h1Spring launchh2CommentsA comment written in Markdown:
h3Launch checklistIts own # heading, shifted down to h3
Simulated: the heading list a screen reader would build from this page's code:
h1Spring launchh2Commentsh3Launch checklist
Check: one h1, no skipped levels.
h3 inside the h2 Comments, so the view keeps its single h1.Why
Screen reader users often start a page by listing its headings, or by jumping to the first h1 and then from level to level. The levels are their map of the page. One h1 tells them where the main content starts and what it is. Levels that step down one at a time tell them which part belongs to which. A jump from h2 to h4 makes them wonder what they missed, and a view with no h1, or with three, gives them no clear place to begin. Whether text is a heading at all is STR-002a, and whether its words describe the part is STR-002b. This guideline only decides the level.
Our reasons
Fewer than two judges have spoken about heading levels, so the verdict is Insufficient evidence (1 of 3 judges spoke) and this guideline is our choice. Material supports it. So does GOV.UK, an expert witness who does not vote. No WCAG criterion requires it. A second h1 or a skipped level is not a documented failure. The Working Group's technique for organising a page with headings under 1.3.1 does nest them this way (G141), and so does its example of h1 to h6 (H42). We follow it for three reasons.
- The levels are a map only if they are kept. People who move by level trust that an
h3belongs to theh2above it. A level picked for any other reason sends them to the wrong place. - One start is easier than several. "Jump to the
h1" is a quick way into the main content, and it only works when there is exactly one. - It is cheap to get right and easy to check. The level follows from the outline the team already has in mind. A linter or a heading list in the browser shows a gap at once.
Do
- In the project tool Ridgeway, the view Project settings has one
h1, Project settings. Its sections Members, Billing address and Delete project areh2. Inside Members, the parts Pending invitations and Current members areh3. - Put the product name in the app shell's header as plain text or a link to the start page, not as an
h1. Theh1sits in each view, insidemain, as STR-004 describes. - On a dashboard, the section This week is an
h2, and each card in its grid has anh3title, one below the section that holds it. - After an
h4deep in Members, the next section Billing address goes back toh2. Going back up any number of levels is fine. - Let a reusable component take its heading level from where it is used.
SettingsSectionacceptsas="h2"oras="h3", or reads the level from a context the parent sets, so it fits both at the top of a view and nested inside another section. - When the view shows rich text or Markdown that a user wrote, shift its headings down so its top heading sits below the view's
h1. A comment's own#heading becomes anh3inside the section Comments, which is anh2. - A dialog is its own context.
DialogTitleis anh2, and that is fine whatever the page behind it uses. It is not a skip, and it need not be anh1. - In the Ridgeway shell, the sidebar's list of projects may have its own
h2, Projects. Where that sits in the outline next to the view'sh1is free. - The view's
h1and its title usually say the same thing. The title is STR-001.
Don't
- Build an app shell where the header shows a logo and every view starts at a
CardTitleor anh2, so no view has anh1. - Put the product name in an
h1in the shared layout and anotherh1in each view. - Follow the
h2Members with anh4Pending invitations, with noh3between. - Hard-code
<h3>insideSettingsSection, so it is one level too deep at the top of a view and right only when nested. - Show a user's Markdown with its
h1intact inside a view that already has one.
Exceptions
- Content the team cannot change. A third-party embed, such as a payment form or a map widget, may bring headings whose levels do not fit the view. Fix what you can around it; the embed itself is outside this guideline.
- Dialogs. A dialog's heading is outside the page's outline; see Do.
- A product that chooses otherwise. This is a guideline. A product that orders its levels another way still marks its headings in code and words them to describe, as STR-002a and STR-002b, both rules, ask.
Verdict
Insufficient evidence (1 of 3 judges spoke). Only the judges decide; the expert witnesses are shown but do not vote. The judges do not settle this one, so it is a guideline: our own choice, with our reasons above. How verdicts work
| Source | Role | Stance | Page |
|---|---|---|---|
| WCAG 2.2 | Law | Supports | 1.3.1 Info and Relationships |
| WCAG 2.2 | Law | Supports | 2.4.6 Headings and Labels |
| Material Design | Judge | Supports | Accessibility designing: structure |
| Apple Human Interface Guidelines | Judge | No position | |
| Carbon Design System | Judge | No position | |
| GOV.UK Design System | Expert witness | Supports | Writing for user interfaces Headings Page template |
| Nielsen Norman Group | Expert witness | No position |
Each stance links to the page it rests on, read on the date in the source register. This page never repeats what a source says; read the source itself.
History
- Version 1.0.0, : First version.
Last checked against the other rules for conflicts on .
More in Page structure: 7 rules and 1 guideline · All rules
Justified is an independent project. It is not affiliated with, sponsored or endorsed by the organisations whose guidance it cites. Read the full statement.
Apple is a trademark of Apple Inc., registered in the U.S. and other countries and regions.