Skip to main content
Albero Academy

Links

The anchor element — the hyperlinks that make the web.

Text & Links8 min

The anchor element (<a>) creates hyperlinks — the connections that make the web a web. Its href attribute sets where the link goes.

Kinds of links

href destinations
<a href="https://example.com">External site</a>
<a href="/about">Another page (relative path)</a>
<a href="#section2">Jump to a section on this page</a>
<a href="mailto:hi@example.com">Send an email</a>
<a href="tel:+911234567890">Call us</a>
<a href="doc.pdf" download>Download a file</a>

Opening in a new tab

Key takeaways

  1. 01The <a> element with href creates hyperlinks.
  2. 02href can be an external URL, a relative path, a #fragment, mailto:, or tel:.
  3. 03target="_blank" opens a new tab — add rel="noopener noreferrer" for security.
  4. 04Write descriptive link text, not "click here".

Finished this chapter?

Mark it complete to track your progress through HTML.