typestar

Links in HTML

The anchor element and the shapes a destination can take.

<nav>
  <a href="/tours">Browse tours</a>
  <a href="#leaderboard">Jump to the leaderboard</a>
  <a href="../settings/">Settings</a>
  <a href="https://example.com" target="_blank" rel="noopener">
    Read the changelog
  </a>
</nav>

How it works

  1. A root-relative path starts with /, a fragment with #.
  2. rel=noopener is the safe default whenever you use target=_blank.
  3. Link text should make sense read on its own.

The run, in numbers

Lines
8
Characters to type
219
Tokens
57
Three-star pace
65 tpm

At the three-star pace of 65 tokens a minute, this run takes about 53 seconds.

Type this snippet

Step 1 of 7 in Links & images, step 16 of 28 in Document structure.

← Previous Next →