On this page
Absolute and Relative Path in HTML
Absolute Path
An absolute path in HTML specifies the complete address or location of a file or resource on the web:
<img src="https://example.com/images/image.jpg" alt="Description">
In this example:
src="https://example.com/images/image.jpg"is an absolute path.- The image
image.jpgis located athttps://example.com/images/.
Relative Path
A relative path in HTML specifies the path to a file or resource relative to the current location of the HTML file:
<img src="images/image.jpg" alt="Description">
In this example:
src="images/image.jpg"is a relative path.- The image
image.jpgis located in theimagesfolder relative to the location of the HTML file.