Absolute vs Relative URLs
Understand the difference between absolute and relative paths.
What Is a URL?
A URL (Uniform Resource Locator) is the full address of a resource on the web.
A URL has these parts:
https://example.com:443/products/widget?color=red#reviews
│ │ │ │ │ │
│ │ │ │ │ └─ Fragment
│ │ │ │ └─ Query string
│ │ │ └─ Path
│ │ └─ Port
│ └─ Domain
└─ ProtocolAbsolute URLs
An absolute URL contains the full address — protocol, domain, and path:
<a href="https://example.com/about">About</a>
<img src="https://cdn.example.com/logo.png" alt="Logo">
<!-- Absolute URLs work from anywhere -->
<!-- Use for: external sites, CDN resources, canonical tags -->