In this article, we will see what is Difference between absolute and relative URL in HTML.

Basically, There are two types of URLs:

1. Absolute URL

2. Relative URL

What is Absolute URL?

In Which the full directory path is included with a domain name or root folder name.

When the domain or root folder is different, this method is typically applied.

Example:

<img src="www.example.com/assets/logo.png" height="300" width="200"/>

What is a Relative URL?

In which only the file path is included without the domain name or root folder name.

utilized most often when the domain or root folder is the same.

<img src="assets/logo.png" height="300" width="200"/>

Found this article helpful?

TutsCoder tutorials are free and ad-light — supported by readers like you. Buy me a coffee (or two ☕☕) as a token of appreciation and help keep Angular & Node.js content coming!

One-time. No subscription. 100% optional. 🙏 Every coffee counts!

Leave a Comment

Your email will not be published. Spam-free zone. ✌️

Available for Projects

Need Help With Your
Angular or Node.js Project?

7+ years of MEAN Stack experience. I build scalable Angular 21 apps, Node.js APIs, and SaaS products — delivered on time, every time.

7+ Years MEAN Stack Angular 21 + Nx Expert 20+ Projects Delivered Remote / Freelance