Linking to a Fragment

The second step is to create a link to the fragment using a standard anchor element with its href attribute. Fragment identifiers are placed at the end of the pathname and are indicated by the hash (#) symbol (formally known as an octothorpe).

To link to the stocks fragment from within dailynews.html, the markup would look like this:

<ahref="#stocks">Check out the Stock Quotes</a>

Get Web Design in a Nutshell, 3rd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.