Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

HTML How to Make a Website Creating HTML Content Structure the Image Gallery

Edson Mendieta
Edson Mendieta
698 Points

Relative Path

Definition of Relative path provided in Teacher's Notes: "...relative to the file that's being referenced."

In the case of the code we are building in this video, is the file that's being referenced the index.html file or the img folder? I believe it is indeed the index.html file since, it has "file" in it's name and "img" is merely a folder, but I just wanted to make sure to get a firmer grasp of this concept in my head.

1 Answer

Kelly von Borstel
Kelly von Borstel
28,880 Points

If you are coding in the index.html file, then it's relative to that file. Here's a link to an article about relative and absolute paths: http://www.coffeecup.com/help/articles/absolute-vs-relative-pathslinks/