Understanding Absolute vs Relative URLs in HTML
📖 Scenario: You are creating a simple webpage for a local bakery. You want to add links to the homepage and to an external website for online orders.
🎯 Goal: Build a basic HTML page with two links: one using a relative URL to the homepage and one using an absolute URL to an external site.
📋 What You'll Learn
Use a relative URL for the link to the homepage
Use an absolute URL for the link to the external online order site
Use semantic HTML5 structure
Include a descriptive
title attribute for each link for accessibility💡 Why This Matters
🌍 Real World
Websites often link to pages within the same site using relative URLs and to other websites using absolute URLs. Understanding this helps keep links working correctly when moving files or deploying sites.
💼 Career
Web developers must know how to write correct URLs in HTML to build reliable navigation and connect to external resources, which is essential for creating professional websites.
Progress0 / 4 steps