<?xml version="1.0" encoding="utf-8"?>

Adding bookmarks with the id attribute

If you have ever binge-read Wikipedia, you'd know how important bookmarks are. They are the links you see in the table of contents that let you jump to whichever section you're interested in — this is especially handy when reading longer articles.

To create a bookmark, you need to:

1. Add an id to the element you want to use as a bookmark — for example, an h2 heading: <h2 id="Сh2">

2. Add a link to the bookmark using the id preceded by a hash (#) as the link's value. For example, <a href="#Ch2">Jump to Chapter 2</a>[1]

When users click on the link, the page will scroll to Chapter 2.

Improve your UX & Product skills with interactive courses that actually work