devnotes.

Linking to Sections, Email, and Files

Beyond linking to other pages, anchor tags can jump to a specific part of the same page, open an email client, or trigger a file download.

Linking to a section on the page using an id:

<a href="#pricing">Jump to Pricing</a>

<!-- further down the page -->
<h2 id="pricing">Pricing</h2>

Clicking the link scrolls the browser directly to the element with id="pricing". This is how "back to top" buttons and table-of-contents navigation work.

Linking to email addresses:

<a href="mailto:hello@example.com">Email us</a>
<a href="mailto:hello@example.com?subject=Question&body=Hi there">Email with prefilled subject</a>

This opens the visitor's default email application with the address (and optionally subject/body) pre-filled.

Linking to phone numbers, useful on mobile:

<a href="tel:+8801234567890">Call us</a>

Triggering a file download with the download attribute:

<a href="/files/notes.pdf" download>Download PDF Notes</a>

Without download, clicking a PDF link usually opens it in the browser tab; with it, the browser saves the file directly instead.