Skip to content
HTML

Links Anchors and Download

Create internal, external, anchor, email, phone, and download links in HTML.

By EZ4Code Team
linknavigationbeginner

Code

<!-- Internal link -->
<a href="/about">About</a>

<!-- External link (open in new tab) -->
<a href="https://example.com" target="_blank" rel="noopener noreferrer">
  External
</a>

<!-- Anchor link -->
<a href="#section-1">Jump to section</a>

<!-- Email and phone links -->
<a href="mailto:[email protected]">Email Alice</a>
<a href="tel:+15551234567">Call us</a>

<!-- Download link -->
<a href="/report.pdf" download>Download PDF</a>

<!-- Image link -->
<a href="/post/1">
  <img src="thumb.jpg" alt="Post thumbnail" />
</a>

Explanation

Covers link types: internal paths, external (target="_blank" with rel="noopener noreferrer" for security), anchor (#id), mailto, tel, and download. rel="noopener noreferrer" prevents tabnabbing attacks when opening new tabs. The download attribute triggers file saving instead of navigation.

More HTML Snippets