File path in HTML | A Quick Guide with Example 📁


Ever wondered how HTML knows where your files are? It's all about the file paths! Let's break it down. 👇

1. Absolute Path:

An absolute path is a full URL to a file, like:


<img src="https://www.example.com/images/picture.jpg" alt="Example Image">


This tells the browser to fetch the file from the web.

2. Relative Path:

A relative path is a file location relative to the current file:

<img src="picture.jpg" alt="Same Folder Image">

<img src="images/picture.jpg" alt="Subfolder Image">

<img src="../picture.jpg" alt="Parent Folder Image">

Pro Tip: Use relative paths for local files to keep your project portable! 🛠️

Keep coding, keep creating! 🚀✨

Thank You
@uvais.codes

Follow our blog for usefull content related like web development, coding and free udemy course 

If you like this content: Buy me a coffee

Previous Post Next Post