Site logo

Archived topic

Anchor link hidden behind sticky menu

3 replies · Started by heliosmp on November 4, 2015

Viewing posts 1–4 of 4

Hi!

I arranged a few anchor links at the beginning of the page. I did it like that:

<a href="#anchor1">Title1</a>
<a href="#anchor2">Title2</a>
<h1 id="anchor1">Title1</h1>
<h1 id="anchor2">Title2</h1>

I have a problem with the sticky menu. The anchored title that you are being redirected after you click on the link gets hidden behind the sticky menu. Any idea how to solve this issue?

...

Hi bdbrown,

thank you for the posting the link.

I checked all these pages.
http://stackoverflow.com/questions/10732690/offsetting-an-html-anchor-to-adjust-for-fixed-header
http://stackoverflow.com/questions/4086107/html-positionfixed-page-header-and-in-page-anchors
https://css-tricks.com/hash-tag-links-padding/

I tried all evening, but nothing worked for my GP theme.

My intention is to use a plugin that creates content tables.
Table of Contents Plus https://wordpress.org/plugins/table-of-contents-plus/

This plugin creates a <span> for every heading h2, h3, h4 ... as you wish
<h2><span id="created-from-heading">Created From Heading</span></h2>
and a content table entry like
<a href="#created-from-heading">Created From Heading</a>

No CSS-trick worked.
Until I found out, there is a checkbox in the backend "Enable smooth scroll effect"
Only when this is checked, you find in the advanced option:
"Smooth scroll top offset"

This archived topic is closed to new replies.