Back to course

Lesson 14: Linking to Internal Page Sections (Anchors)

The HTML Masterclass: From Zero to Web Developer

14. Linking to Internal Page Sections (Anchors)

You can use links to jump to a specific location (anchor) within the same page or another page.

14.1 Step 1: Define the Target (ID Attribute)

Assign a unique id to the element you want to jump to. Remember, id values must be unique across the entire document.

html

Table of Contents

Conclusion and Next Steps

This is the final section of the document.

14.2 Step 2: Create the Link

In the href attribute, use a pound sign (#) followed by the id name.

html

14.3 Linking to an Anchor on a Different Page

You can combine a relative path and an anchor to link directly to a section on another page.

html

Read Chapter 3