Lesson 8 / 28

Links

Connect pages with the anchor tag.

The anchor tag

<a href="..."> creates a clickable link; the href attribute is the destination.

<a href="https://example.com">Visit Example</a>
<a href="/about.html">About Us</a>
<a href="#top">Back to top</a>

Opening in a new tab

target="_blank" opens a link in a new tab. Pair it with rel="noopener noreferrer" for security.

<a href="https://example.com" target="_blank" rel="noopener noreferrer">Open safely</a>

Relative vs absolute

/about.html is relative to the current site; https://example.com is absolute and points anywhere on the web.