HTML Essentials

Links

Connect pages and resources with useful links.

The anchor element creates a link. Its href attribute tells the browser where to go.

Important definitions

Anchor
The a element used for links.
URL
The address of a resource.

Syntax

Use this general pattern as a reference:

HTML
<a href="destination">label</a>

Examples

Links worked example

EXAMPLE 1
<a href="https://example.com">Visit Example</a>
ResultA clickable Visit Example link.
Try it yourself

Expected output

A clickable Visit Example link.

Note

Link text should describe the destination.

Tip

Prefer descriptive labels over Click here.

Common mistakes

  • Using an image path as link text.
  • Opening every link in a new tab.