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 HTML Basics Images, Text and Links Understanding File Paths

File path ../

Hi, is there someone that is able to explain me the purpose of the ../? I very confused about it! Thank you in advance!

Louise St. Germain
Louise St. Germain
19,424 Points

That means to go up one folder in the folder structure. This is relative to the current file.

If the document you're linking to is in the same folder, you'd simply use <a href = "file_name.html">xyz</a>. If it's in a subfolder (a folder below) your current location, you'd use <a href = "subfolder_name/file_name.html">xyz</a>. But here it's in the folder above so you'd use <a href = "../file_name.html">xyz</a>. (You don't even need to specify the folder name - since it already knows which folder is above yours!)

That way you can avoid having to put an entire absolute path in there.

1 Answer

Hi Sebastien,

the two dots ".." are used to to say "go one folder out of the current folder".

So for example if you have two folders, one with "articles" (with html files of articles) and one with "images" (with image files) and you want to link to an image file from one of the articles then you need to go out of the "articles" folder and then enter the "image" folder like this: "../images/picture-name.jpg"

Does that make sense to you?

Happy coding!

Nils