Same-Page Linking with Anchor Tags

A Simple HTML Guide

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.

1

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>
Note: The `id` must be unique on the page.