Opened 6 months ago

Last modified 5 months ago

#5867 new defect

Anchor links headline invisible behind top menu bar. Should have compensating offset.

Reported by: abitofmind Owned by:
Milestone: Priority: lowest
Component: Site Keywords:


Otherwise when jumplink to the target of an anchor link by TOC or direct deep link the arriving user does not see the heading and may be disoriented or not get the context at first.

There are even ready made WordPress plugins to do this like i.e.:
and I assume also some themes have such offset-compensation-mechanisms built in.

See screenshots of the problem and the proposed solution:

Attachments (4)

WordPressOrg anchor link invisible 1.png (156.8 KB) - added by abitofmind 6 months ago.
WordPressOrg anchor link invisible 2.png (163.5 KB) - added by abitofmind 6 months ago.
WordPressOrg anchor link invisible 3.png (145.4 KB) - added by abitofmind 6 months ago.
WordPressOrg anchor link invisible 4.png (146.7 KB) - added by abitofmind 6 months ago.

Download all attachments as: .zip

Change History (11)

#1 @jonoaldersonwp
6 months ago

  • Priority changed from normal to lowest

This can be solved with some simple CSS; see scroll-margin-top

#2 @abitofmind
5 months ago

Didn't know about this CSS attribute! Great.


  • I'm merely the reporter, not an active part of a WP team.
  • Are there plans to improve this? In the default theme? Or in the instance?

#3 @jonoaldersonwp
5 months ago

All open tickets get reviewed and triaged, though resource is short, and this is likely to be of low priority. Should be an easy fix, though, so hopefully, it'll land on without taking years...

#4 @abitofmind
5 months ago

Thanks for informing us here about the team workflow.
It's a quick win — quite a usability gain achievable with not too much effort — so that again should prioritize it higher, I hope.

Anyway sharing CSS scroll-margin-top is a good hint for individual CSS workarounds for many blogs/themes out there who may arrive here via a search engine. Thanks!

This ticket was mentioned in Slack in #forums by abitofmind. View the logs.

5 months ago

#6 @abitofmind
5 months ago

The deficiency outlined in this very issue also manifests itself in this/these issue(s):

  • #5877 (among other issues)

#7 @abitofmind
5 months ago

Found plugin Fixed Menu Anchor which deals with the symptom. It was last updated circa 2016.

As CSS attribute scroll-margin-top got major browser support only ca. 2018-2020, I assume that plugin involves some Javascript. A pure native CSS surely works smoother. But maybe a workaround for some in the meantime.

Note: See TracTickets for help on using tickets.