Black Friday Sale! Get up to $40 off GP Premium!Learn more

Reply To: Offset anchors with fixed header

Home Forums Support Offset anchors with fixed header Reply To: Offset anchors with fixed header

#190498
Tom
Lead Developer
Lead Developer

If you highlight your code and click the “code” button in the editor above, it will make it a lot easier to post.

So at the top, you would have:

<a href="#my-section">My section</a>

Then you would have your section:

<a name="my-section class="anchor"><!-- a section --></a>

Then this CSS:

a.anchor {
    display: block;
    position: relative;
    top: -60px; /* height of sticky navigation */
    visibility: hidden;
}
  • This reply was modified 4 years, 6 months ago by Tom.