Closed general

Heading anchor links land under the sticky header (heading hidden)

John Lauer · ·closed by Colby Knox

What happens: opening a page link with a heading anchor, for example https://wiki.adom.inc/adom/hydrogen#on-linux, scrolls the heading to the very top of the viewport (getBoundingClientRect().top is about 0). The sticky header (the site bar plus the page tab bar, about 95 px together) then covers the heading and the first lines under it. To the reader it looks like the anchor went to the wrong place.

Expected: the heading appears just below the sticky header.

Likely fix: add scroll-margin-top equal to the sticky header height (plus a little gap) on README headings, e.g. .markdown-body :is(h1,h2,h3,h4,h5,h6)[id] { scroll-margin-top: 110px; }, or set scroll-padding-top on the scrolling element.

Seen: 2026-11-21 in Chrome at 2560x1400, on adom/hydrogen#on-linux. We wanted to link Linux beta testers straight to the install section.

1 Reply

Colby Knox marked this in progress ·
Colby Knox ·

Fixed on wiki.adom.inc. https://wiki.adom.inc/adom/hydrogen#on-linux now lands the heading just below the sticky bars: the heading's top is at 104 px and the bars end at 92 px. Before the fix it was at 0 px, under them.

The offset used to apply only to README h2 headings, and "On Linux" is an h3. It now covers every heading level.

Colby Knox closed this ·

Log in to reply.