HTML File Paths
A file path indicates the location of a file inside a folder structure. Its like an address of a file which helps the web browser to access the files. File paths are used to link external resources such as web pages, images and videos etc etc.
For example: <a href="contactus.html">Contact Us</a>
The syntax is used to link a contactus.html file, where the path of the file is mentioned in the href attribute.
- Absolute File Paths
- Relative File Paths
Absolute File Paths: It describes the full address(URL) to access an internet file.
Example: <a href= "https://www.google.com/">Google</a>
Relative File Path: It describes the path of the file relative to the location of the current web page file.
Example: <a href= "../home.html">Home</a>
File Path Examples
Path | Description |
---|---|
<img src="car.jpg"> | The "car.jpg" file is located in the same folder as the current page |
<img src="../car.jpg"> | The "car.jpg" file is located in the folder one level up from the current folder |
<img src="images/car.jpg"> | The "car.jpg" file is located in the images folder in the current folder |
<img src="../images/car.jpg"> | The "car.jpg" file is located in the images folder one level up from the current folder |
<img src="/images/car.jpg"> | The "car.jpg" file is located in the images folder at the root of the current web |
Practice exercise:
1.Write an html code to display the web page as follows. Display the books.jpg located at images folder in the current directory. View
Sri Hari Book Store

Mission
"sriharibookstore.com is committed to bringing the most convenient, easy and secure shopping experience on the web."
Products
10 Million Books across 20+ Languages, Audio Books, Gadgets & Accessories, Toys, Electronics, Mobiles & Tablets Accessories, Health Care Devices and Many More Stores.
Highlights
sriharibookstore.com has been awarded the most promising Start-Up company 2013.
The Most Prompt Customer Service & Support 2013-2014.
India's largest Book Warehouse - India Book of Records 2013 -2014.