The HTML anchor tag (``) can create hyperlinks that let users jump to a specific section on the same page. This is great for long documents or a table of contents. This guide will show you how in two simple steps.
Create the Destination
First, you need to mark the place where the link should jump to. You do this by adding a unique `id` attribute to the destination element (like a heading or a paragraph).
<!-- The destination element later in the page -->
<h2 id="section-two">This is Section Two</h2>
Create the Link
Next, create the anchor `` tag. Its `href` attribute must start with a hash symbol (`#`) followed by the exact `id` of the destination element you created in Step 1.
<!-- The link -->
<a href="#section-two">Jump to Section Two</a>
Live Example: This page uses this technique. Click the "Conclusion" link in the header to see it in action. It will smoothly scroll you to the bottom of the page.