A long page on a small screen
A guide that fits on one desktop screen takes many thumb-swipes on a phone. A patient who wants the part about billing questions, or a spouse who wants the directions, should not have to scroll through everything else first. A short list of links at the top solves that.
This is the same idea a web accessibility standard has described for years. The W3C's explanation of the bypass blocks criterion, Success Criterion 2.4.1, is about letting people reach the main content without moving through repeated material first. Its techniques include links at the top of the page to each content area, and headings at the beginning of each section.
When a table of contents is worth adding
- The page has five or more headed sections.
- A reader is likely to want only one part, such as hours, what to bring or insurance questions.
- The page is long enough that a phone shows the first section and nothing else for many swipes.
- Do not add one to a short page; a list of links longer than the text it points to is clutter.
How to build it
- 1Write clear section headings first. If a heading is vague, the link will be too.
- 2Give each heading an anchor, which is a name the link can point to. Your web person or editor can do this with an id on each heading.
- 3Place the list after the first answer paragraph, not above it. The reader should still see the answer first.
- 4Use the heading text itself, or a shortened version, as the link text, one link per section.
- 5Make every link big enough to tap with a thumb, with space between lines.
| Do | Avoid |
|---|---|
| Short labels that match the headings | Labels such as Section 3 or Next part |
| One link per heading, in page order | Links to every sub-heading, which turns the list into a second page |
| A visible list in the page text | A hidden list that only opens on a script event |
| Links that scroll to the heading and show it | Links that leave the heading hidden under a fixed header bar |
Check the heading is not hidden after the jump
A fixed bar across the top of a phone page can cover the heading a jump link scrolls to. Tap each link on a real phone and confirm the heading is visible, not tucked under the bar. If it is covered, your web person can add space above each heading for the jump.
Why the headings come first
A table of contents is only as good as the outline it reflects, so fix the headings before adding links. Our guide to heading structure from H1 to H3 shows how to keep a clean outline, and the guide on plain language and reading level helps with the words themselves.
Because Google indexes the mobile version first, what a phone reader sees is what a search engine reads. See mobile-first indexing explained for a medical practice website. A table of contents is also a natural companion to the click-to-call button and mobile layout, since both put the next step within reach.
A two-minute phone test
- Open the page on a phone and count how many swipes it takes to reach the last section without the list.
- Tap the third link and watch where the page lands.
- Turn on a screen reader or ask a staff member who uses one to find the list. It should be announced as a list of links before the sections begin. The same care applies to the links in a contents list, which should be recognizable without relying on color, as shown in making links in body text stand out beyond color.
- Tap the browser's back button after a jump. It should return to a sensible place.
Frequently asked questions
Does a table of contents improve search rankings?
We cannot promise that. Its job is to help readers, especially on phones, get to the part they need, and that benefit stands on its own.
Should it be at the very top?
Put it after the answer to the page's main question. The reader should see the answer first, then the list for anything else.
How many items is too many?
If the list is longer than about seven items, the page may be trying to do too much. Consider splitting it into two guides.
Can the list collapse on a phone?
It can, but an open list is simpler to use and to read aloud. If it collapses, label the button plainly and make sure it works with a keyboard.
Who adds the anchors?
Your editor or web person. Many page builders add them automatically; ask to see the list working on a phone before you approve it.
Sources
- W3C Web Accessibility Initiative — Understanding Success Criterion 2.4.1: Bypass Blocks