HTML Foundations: Module 3

← Dashboard
Module 3: The Interaction

Links & Navigation

Connect pages with the <a> tag. Use relative paths for your own pages and absolute URLs for external sites.

<!-- Absolute: full URL -->
<a href="https://coffee.com">External Link</a>

<!-- Relative: same site -->
<a href="menu.html">View Menu</a>

<!-- Navigation bar -->
<nav>
  <a href="index.html">Home</a>
  <a href="menu.html">Menu</a>
  <a href="contact.html">Contact</a>
</nav>

Build Your First Nav Bar

Pro Tip

Use target="_blank" to open links in a new tab. Add rel="noopener" for security.

Anchor

Link to a section: <a href="#contact">. The target needs id="contact".