Last updated Oct 13, 2022

Difference between absolute and relative URL in HTML

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

Difference between absolute and relative URL in HTML

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"/>

Tags

Available for projectsLet’s build together

Need this built properly,
not just explained?

I take on Angular and NestJS work directly — auth systems, multi-tenant SaaS, API rewrites and the deploy pipeline underneath them. You talk to the person writing the code.

Projects delivered
20+ Projects delivered
Angular • NestJS
7+ years Angular • NestJS
Average reply time
1 day Average reply time

What I can help with

  • Auth and permissions systems
  • Multi-tenant SaaS foundations
  • API design and rewrites
  • Deploy pipelines and VPS setup
  • Bug fixing and performance optimization
Send me a message

Tell me about your project and I’ll get back with a realistic scope and price.

Turn
Your Ideas
Into Reality

Stay in the loop

Get the finished tutorials, projects and resources in your inbox.

Join 5,000+ developers and get new tutorials, source code, product updates and exclusive content — straight to your inbox.

  • No spam
  • Useful content only
  • Unsubscribe anytime

Subscribe to TutsCoder

Be the first to get new tutorials, projects and tips.

Join 5,000+ developers already learning with us.

Learn
Build
Grow

Discussion

Comments

Share your thoughts, ask questions or suggest improvements. Let’s learn and grow together!

Loading comments…

Join the discussion

Sign in to join the discussion. Your account also keeps your saved tutorials and path progress.