Skip to content

01. Links

Links (hyperlinks) are fundamental to the web, connecting pages and resources together. The HTML anchor tag (<a>) creates clickable links that allow users to navigate between pages, jump to sections, download files, and interact with web content. Understanding how to create and use links is essential for web development.

<a href="https://example.com">Link Text</a>

The destination URL:

<a href="https://example.com">Visit Example</a>
<a href="/page.html">Internal Page</a>
<a href="#section">Jump to Section</a>

Where to open the link:

<a href="https://example.com" target="_blank">New Tab</a>
<a href="/page.html" target="_self">Same Window</a>

Relationship type:

<a href="https://external.com" rel="noopener noreferrer">External Link</a>
<a href="https://example.com">External Site</a>
<a href="/about.html">About Page</a>
<a href="../contact.html">Contact</a>
<a href="#section1">Jump to Section 1</a>
<section id="section1">Content</section>
<a href="mailto:email@example.com">Send Email</a>
<a href="tel:+1234567890">Call Us</a>
<!-- Good -->
<a href="/about">Learn more about us</a>
<!-- Avoid -->
<a href="/about">Click here</a>

Use rel="noopener noreferrer" for external links:

<a href="https://external.com" target="_blank" rel="noopener noreferrer">External</a>