AI websites

Step-by-step tutorial

How to Fix Section Headings Hidden Behind Your AI Website's Header

Fix a contents link that scrolls to the right section but hides its heading behind a fixed header. Check the target, add scroll spacing, and verify narrow screens.

Product links on this page are ordinary official links. No affiliate commission is currently attached. Read our disclosure.

Quick answer

If a contents link scrolls down but the heading disappears behind the top navigation, check the link target first. If it is correct, add space to the scroll position.

A common fix is scroll-margin-top on the target heading. Its value should allow room for the actual fixed or sticky header and a small gap. MDN explains this property.

Work in a preview or saved copy of your site. You can ask your coding assistant to make and test the change.

Click the contents link and look at the address. A section link may end in something like #pricing.

Ask your assistant to confirm that the intended heading has the matching ID:

<a href="#pricing">See prices</a>
<h2 id="pricing">Prices</h2>

If the matching section is missing or the link points somewhere else, fix that destination first. Our website link checklist covers those problems.

If scrolling slightly upward reveals the right heading under the navigation, the header may be covering the target.

Step 2. Leave room for the header

Give your assistant the page address, the link label, and a screenshot showing what happens.

On [page URL], clicking [See prices] scrolls to #pricing,
but the fixed header hides the Prices heading.
Confirm the target ID, then inspect the header height.
Add the smallest scroll-spacing fix for this target.
Check desktop and narrow screens. Show the change before publishing.

For a header that takes up 80 pixels, this example allows 16 more pixels of breathing room:

#pricing {
  scroll-margin-top: 96px;
}

96px is an example, not a universal setting. The right space depends on your header. Mobile navigation may wrap onto another line or change height when opened.

Keep the heading in its natural place. Adding blank paragraphs above it can leave awkward gaps for visitors who scroll normally.

Step 3. Check which element actually scrolls

If the page still hides the heading, tell your assistant exactly what moves.

  • The whole browser page scrolls. Check the heading’s scroll margin and the header’s current height.
  • Only a panel scrolls. The panel may be the scrolling container. A setting on the outer page might not affect it.
  • The jump is controlled by JavaScript. Ask whether that code overrides the browser’s normal section navigation.

For several affected headings, your assistant may choose scroll-padding-top on the scrolling container instead. It reserves space in that container’s scroll area. Have it explain the chosen approach before adding both properties. MDN documents scroll padding.

Step 4. Verify the visitor’s route

In the preview:

  1. Start above the section and click the original link.
  2. Confirm the full heading appears below the navigation.
  3. Open the page directly with the section address, such as /services/#pricing.
  4. Repeat at narrow widths and with the menu closed and open, if it stays open after selection.
  5. Check another section link and normal scrolling for unwanted gaps.

After publishing, repeat at the real URL using the safe update checklist.

What we checked

In a controlled local example, an 80-pixel fixed header covered the target heading after a section-link jump. Adding a 96-pixel top scroll margin left the heading visible at desktop, 390px, and 320px widths. We checked the link jump and a direct section address.

The sample used a fixed-height header and normal page scrolling. A changing header or a separately scrolling panel needs its own test. Official documentation checked November 13, 2026.