View video tutorial

HTML Paths


HTML file path means location a file going to be accessed.

File Location / File Path

When we need a resource to access we use the location or path for that resource.

We can add external or internal resources to a webpage using path.

There are many resources like audio, video, image, css, script, pdf, html, or any other files are to be linked or added to a page.

Path can be of two types absolute path and relative path.

Absolute path tells full location of a resource starting from root path.

Relative path tells location of the file from the current referencing point or current page regardless website root.

To make code independent it is better to use relative path as much as possible.

Learning with HTML Editor "Try it Now"

You can edit the HTML code and view the result using online editor.


<!DOCTYPE html>
    <title>HTML path Example</title>
    <!--Example: Html Path-->
    <h1>Absolute Path</h1>
    <p><a href="" target="_blank">Link opens in a new window</a></p>
    <h1>Relative Path</h1>
    <p><a href="./basic/html-iFrame.jsp" target="_blank">Link opens in a new window</a></p>

Try it Now »

Click on the "Try it Now" button to see how it works.