📡 You're offline — showing cached content
New version available!
Quick Access
Tutorials HTML Fundamentals Links

Links

5 min read Quiz at the end
Links use the a tag with href for the URL. Add target='_blank' rel='noopener noreferrer' for external links. Use mailto: for email and tel: for phone links. Always use descriptive link text instead of 'click here'.

Hyperlinks

<!-- External link -->
<a href="https://example.com">Visit Example</a>

<!-- Open in new tab -->
<a href="https://example.com" target="_blank" rel="noopener">New Tab</a>

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

<!-- Anchor (same page) -->
<a href="#section1">Go to Section 1</a>

<!-- Email and phone -->
<a href="mailto:hello@example.com">Email us</a>
<a href="tel:+1234567890">Call us</a>
Topic Quiz · 5 questions

Test your understanding before moving on

1. Which attribute specifies the link destination?
💡 The href attribute specifies the URL the link goes to.
2. target="_blank" opens a link in:
💡 target="_blank" opens the link in a new browser tab.
3. Why add rel="noopener" to target="_blank"?
💡 rel="noopener" prevents the new page from accessing the opening page via window.opener.
4. Which link goes to an email client?
💡 href="mailto:email@example.com" opens the user's email client.
5. How do you link to a section on the same page?
💡 href="#id" links to the element with that id on the same page (anchor link).