Menu
Links & Navigation

<a> Anchor Links

The link element — internal, external, mailto, tel, and download.

1All Kinds of Links

The <a> element creates hyperlinks. The href attribute holds the destination — a URL, an in-page anchor, an email, a phone number, or a download.

Example Code
<a href="https://example.com">External</a>
<a href="/about">Internal</a>
<a href="#section-2">Jump to section</a>
<a href="mailto:hi@site.com">Email us</a>
<a href="tel:+15551234567">Call us</a>
<a href="/file.pdf" download>Download PDF</a>

2Safe External Links

When opening links in a new tab with target="_blank", always add rel="noopener noreferrer" to prevent the new page from accessing window.opener.

Example Code
<a
  href="https://external.com"
  target="_blank"
  rel="noopener noreferrer"
>
  Open in new tab
</a>

Finished reading?

Mark this topic as complete to track progress.