Suggest an editImprove this articleRefine the answer for “What is the difference between absolute and relative links?”. Your changes go to moderation before they’re published.Approval requiredContentWhat you’re changing🇺🇸EN🇺🇦UAPreviewTitle (EN)Short answer (EN)**An absolute link** contains the full path to a resource with a protocol and domain (`https://example.com/about.html`), while a **relative link** specifies the path only relative to the current file or directory (`about.html`, `../index.html`), without a domain. **Key point:** absolute links work anywhere and are used to link to another site, while relative links work only within a single site but need no changes when the site is moved.Shown above the full answer for quick recall.Answer (EN)ImageAbsolute and relative links differ in **how they specify the path to a resource** (a page, file, image, and so on). --- ### **Absolute link** An absolute link contains the **full path** to the resource: including the protocol (`http://` or `https://`), the domain, and, if needed, folders and files. **Example:** ```html <a href="https://example.com/images/photo.jpg">View the photo</a> ``` **Features:** - Works **always and everywhere**, regardless of where the HTML file is located. - Used when you need to go to **another site** or specify the page's exact address. - Downside: if the site or domain changes, the link stops working. **Example of linking between sites:** ```html <a href="https://wikipedia.org/wiki/HTML">More on Wikipedia</a> ``` --- ### **Relative link** A relative link specifies the **path relative to the current file or directory**. It does not contain a domain or protocol. **Examples:** ```html <a href="about.html">About the company</a> <!-- File in the same folder --> <a href="folder/page.html">More details</a> <!-- Nested folder --> <a href="../index.html">To the homepage</a> <!-- One level up --> ``` **Features:** - Works **only within a single site**. - Convenient during development, when moving the site, the links do not need to change. - The browser fills in the current domain on its own. --- ### **Key difference:** | Link type | What it looks like | Where it is used | Example | |---|---|---|---| | Absolute | Full URL with a domain | For linking to another site | `https://example.com/about.html` | | Relative | Path within the site | For internal pages | `about.html` or `../index.html` | --- **Conclusion:** Absolute links are like a full address with a city and country. Relative ones are like saying "turn the corner" within a single neighborhood.For the reviewerNote to the moderator (optional)Visible only to the moderator. Helps review go faster.