Course contentsShow
← Web Development
Lesson 72 of 2,9822. HTML FundamentalsFree lesson

Hyperlinks Fundamentals

Create links with <a>, understand href, target, and link best practices.

Hyperlinks Fundamentals

You'll learn how to create clickable links that connect web pages together using the <a> element.

What is a Hyperlink?

A hyperlink (or just "link") is the fundamental building block that makes the Web a web. It's what transforms separate documents into an interconnected network. Think of links as doorways between pages—click one, and you're transported somewhere new.

The <a> Element

The anchor element <a> creates links. The most important attribute is href (hypertext reference), which tells the browser where to go:

<a href="https://example.com">Visit Example</a>

The text between the opening and closing tags becomes the clickable link.

Essential Attributes

href (required)

This is the destination URL. It can be:

  • Absolute URL: href="https://example.com/about" (full web address)
  • Relative URL: href="about.html" (within your own site)
  • Email link: href="mailto:hello@example.com"

target

Controls where the link opens:

  • target="_self" (default): Opens in same tab
  • target="_blank": Opens in new tab
<a href="https://example.com" target="_blank">Open in new tab</a>

Link Best Practices

  1. Use descriptive text: Write "Read our privacy policy" instead of "Click here"
  2. Be careful with _blank: New tabs can confuse users
  3. Link text should make sense alone: Screen readers often navigate by links
  4. Don't link just to link: Every link should have purpose

Key Takeaway: The <a> element with an href attribute creates hyperlinks—the connective tissue of the Web. Use descriptive link text and choose the appropriate target behavior for better user experience.