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
Accessible Form with Inputs
Build an accessible HTML form with labels, inputs, select, and checkbox.
Table with Thead Tbody Tfoot
Structure tabular data with thead, tbody, tfoot, and caption in HTML.
Responsive Images and Video
Embed responsive images with srcset, video, audio, and figure in HTML.
Semantic Tags
HTML5 semantic structure.
Form Validation
HTML5 form validation.
SVG
Scalable Vector Graphics.