codegurukool.com · Free coding tutorials & online compiler

Home › HTML Tutorial › File paths

File paths

Point to files correctly.

img.png is in the same folder, images/img.png in a subfolder, /images/img.png from the site root and ../img.png one level up.

Example code

<!-- same folder  --> <img src='pic.jpg'>
<!-- subfolder    --> <img src='images/pic.jpg'>
<!-- root         --> <img src='/images/pic.jpg'>
<!-- parent       --> <img src='../pic.jpg'>
<p>Paths are shown as comments.</p>'

Run this code in the online editor

← JavaScript in HTMLHTML head and meta →