What Is a Relative Path?

Dan Gold

Written by Dan

Relative path means that you are specifying the location of a file or folder relative to the location of the current file or folder.

An example of a relative path in web development would be if you wanted to link to an image that is located in the same folder as your HTML file. You would type ../img/dog.jpg into your HTML document and the browser would know to look for the img folder inside of the folder that contains your HTML file and then find the file dog.jpg inside of that folder.

Last updated

November 8th, 2022