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

Why Use ../ over / in html file paths

If / goes to the root and gives you access to all folders anyway why use ../?

Surely / is safer should files move?

7 Answers

You're right. Just remember that / does not work if you don't have your website hosted on a server, or using xampp or something similar.

Im using "../../index.html" and it still not working ?!

../ takes you one level up... ./ - the same directory

I just used "/index.html" instead of ../..index.html and it worked too

../..index.html didn't work and I used /index.html and that did. Why is that? Anyone know?

../..index.html - this is wrong syntax. Two dots can only go before forward slash taking you one level up.

What is the proper way to get back to the root folder? /index.html?

/ - just forward slack will take you to the root folder ./ - your current folder ../ - one level up

Thanks