Thumbnail for Hyperlinks episode.
2 minutes

Hyperlinks and Navigation - Charting Your Web Course!

Ahoy, fellow adventurers! In this thrilling chapter of our HTML escapade, we’re delving deep into the art of navigation. Grab your compass and buckle up; we’re about to set sail into the world of hyperlinks and crafting the pathways of the web.

Hyperlinks, or simply links, are the secret passages connecting the vast landscape of the internet. They’re the magic keys that unlock new realms. The <a> (anchor) element is your trusty spellbook for weaving these enchantments.

<a href="https://www.mysticalisland.com">Discover the Mystical Island</a>

The href attribute is the destination coordinates. It could be a different web page, a file, or even another section of the same page.

There are two main types of links: internal and external. Internal links transport you within the same kingdom, while external links teleport you to other realms.

  • Internal Link:
    <a href="castle.html">Explore the Royal Castle</a>
    This link will redirect the visitor to the page castle.html which is a part of your website, that page is internal
  • External link:
    <a href="https://www.magicalforest.com">Venture into the Magical Forest</a>
    This link will redirect the visitor to whole new website: www.magicalforest.com which is external to your website.

Anchor links are like hidden treasures. They allow you to jump to specific spots on the same page. Attach an anchor to an element using the id attribute and link to it with your anchor tag.

<a href="#treasures">Uncover the Riches</a>
<!-- Other HTML tags -->
<h2 id="treasures">Discover the Hidden Treasures</h2>

When the visitor clicks on this link, they will stay on the same page but will be transported to wherever the title Discover the Hidden Treasures is located in the page.

To guide your fellow explorers, craft navigation menus with a series of links.

<nav>
  <a href="index.html">Home</a>
  <a href="about.html">About Us</a>
  <a href="adventures.html">Adventures</a>
  <a href="contact.html">Contact</a>
</nav>

With these HTML treasures, you’re now equipped to navigate the web seas like a seasoned captain. In our next episode, we’ll unveil more HTML secrets to enhance your web odyssey. Stay curious, and may your links always lead to magical discoveries! 🗺️✨

Photo of Armands Brants from Unsplash