Horje
How to relative File Paths

A relative file path points to a file relative to the current page.

 


Full Example of relative File Paths

In the following example, the file path points to a file in the images folder located at the root of the current web:
index.html
Example: HTML
<!DOCTYPE html>
<html>
<body>

<h2>Using a Relative File Path</h2>
<img src="https://itupto.com/avatar.png" alt="Profile" style="width:300px">

</body>
</html>

Output should be:

Full Example of relative File Paths

In the following example, the file path points to a file in the images folder located in the current folder:
 <img src="/images/picture.jpg" alt="Mountain"> 

In the following example, the file path points to a file in the images folder located in the folder one level up from the current folder:
 <img src="../images/picture.jpg" alt="Mountain"> 





Category:
Web Tutorial
Sub Category:
HTML File Paths
Uploaded by:
Admin


Read Article
https://develop.horje.com/learn/1434/reference