How to create a bookmark link in HTML | Going to different part of same web page by hyperlink

Using bookmarking of links in HTML you can reach different parts of the same page.This can be done by defining an element id and this id can be given in href attribute of <a> tag so by clicking on the link you can reach the targeted part of the page.

Example

<!-- Bookmarking using links -->

<a href="#C1">Jump to Chapter 1</a><br/>
<a href="#C2">Jump to Chapter 2</a><br/>
<a href="#C3">Jump to Chapter 3</a><br/>
<a href="#C4">Jump to Chapter 4</a><br/>
<br/><br/><br/><br/>

<h2 id="C1">Chapter 1</h2>

<p>Lorem ipsum, or lipsum as it is sometimes known, is dummy text used in laying out print, graphic or web designs. The passage is attributed to an unknown typesetter in the 15th century who is thought to have scrambled parts of Cicero's De Finibus Bonorum et Malorum for use in a type specimen book. It usually begins with:</p>
<br/><br/><br/>
<h2 id="C2">Chapter 2</h2>

<p>Lorem ipsum, or lipsum as it is sometimes known, is dummy text used in laying out print, graphic or web designs. The passage is attributed to an unknown typesetter in the 15th century who is thought to have scrambled parts of Cicero's De Finibus Bonorum et Malorum for use in a type specimen book. It usually begins with:</p>

<br/><br/><br/>
<h2 id="C3">Chapter 3</h2>

<p>Lorem ipsum, or lipsum as it is sometimes known, is dummy text used in laying out print, graphic or web designs. The passage is attributed to an unknown typesetter in the 15th century who is thought to have scrambled parts of Cicero's De Finibus Bonorum et Malorum for use in a type specimen book. It usually begins with:</p>

<br/><br/><br/>
<h2 id="C4">Chapter 4</h2>

<p>Lorem ipsum, or lipsum as it is sometimes known, is dummy text used in laying out print, graphic or web designs. The passage is attributed to an unknown typesetter in the 15th century who is thought to have scrambled parts of Cicero's De Finibus Bonorum et Malorum for use in a type specimen book. It usually begins with:</p>

<br/><br/><br/>
<h2 id="C5">Chapter 5</h2>

<p>Lorem ipsum, or lipsum as it is sometimes known, is dummy text used in laying out print, graphic or web designs. The passage is attributed to an unknown typesetter in the 15th century who is thought to have scrambled parts of Cicero's De Finibus Bonorum et Malorum for use in a type specimen book. It usually begins with:</p>

Leave a Comment