How to create links to Sections?


#1

Hello,

Let’s say I have 1 first Section at the top of my page with several buttons, and when I click on these buttons, I want it to go to different Sections (below) on that same page.

How can this be done?

Thank you !
Stephanie


#2

This can be done by adding hash URL to the button and the same ID to the respective sections.

For example: Let name a section as help. In this case, the button will have a hash URL which will be #help and then the ID of that section will be help. After this, when you will click on the button, it will scroll to the respective section which will have ID as help.


#3

Thank you Danish for your response. I used the #url and ID, it works fine.
Quick additional question :

Can you set an offset for that “anchor”?
Or is it always the top of the page?

Thank you again.


#4

Sorry, I did not get that exactly.
Could you please explain that?


#5

Hi again,
Well, upon click, I would want the top of the Section to appear at the top of the page, but slightly below, right after the navigation menu.

Let’s say your navigation’s height is 200px… I don’t want the top of the Section to appear underneath the navigation menu, but start at 200px, right after the navigation. …if you see what I mean. ; )

But strangely if I’m a bit scrolled down in the page, the link works… It doesn’t always react in the same way.


#6

If I get it right, when you scroll using the anchor, the sticky header hides some part of that section underneath? Is that what you mean?

If yes, you will have to add some top padding to the section to which you have added the ID.

If not, then please share the site URL so that I can understand what you are talking about?