The simplest way is to just give the href #id_name in your navigation bar “a" tag link, and then give this href hash name to the content section id attribute where should be navigate to. Then this will navigate to section where you have added this name as a id in the page.
- How do I link to an element on the same page?
- How to create links to sections on the same page in Javascript?
- How do I navigate to a specific part of a page?
How do I link to an element on the same page?
Linking to an element on the same page
Note: You can use href="#top" or the empty fragment ( href="#" ) to link to the top of the current page, as defined in the HTML specification.
How to create links to sections on the same page in Javascript?
To do this, position your cursor on the page where you would like the link to appear, and then go to Insert > Link. In the window that appears, enter the text you would like to appear as a link, and in the URL Field, enter #targetname, where targetname is the name of your target. In our example, we would enter #jsmith.
How do I navigate to a specific part of a page?
One can use the anchor tag to redirect to a particular section on the same page. You need to add ” id attribute” to the section you want to show and use the same id in href attribute with “#” in the anchor tag.