Site logo

Archived topic

Anchor point hidden by Menu

3 replies · Started by Ronny on November 3, 2019

Viewing posts 1–4 of 4

Hello,
I try to make my own TOC and when it jumps to the anchor mark the actual heading is hidden by the menu. Is there a possibility to add some space?
This is a try page to see the problem.
https://www.diving-canary-islands.com/sitemap-try/

Hi there,

You can try add this CSS hack to your headings - first your Heading markup would be like this:

<h2 class="jump-link">Heading listed in the TOC</h2>

Then this CSS:

h2.jump-link {
    padding-top: 70px;
    margin-top: -70px;
}

The only negative is some older browsers may ignore the padding offset method.

It's working :) Thank you, just switched to 100px to have a little more space

Glad to be of help

This archived topic is closed to new replies.