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

Steven Barrett
Steven Barrett
1,382 Points

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

Sem Peters
Sem Peters
3,669 Points

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 ?!

Dmitry Polyakov
Dmitry Polyakov
4,989 Points

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

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

Christopher Ruiz
Christopher Ruiz
1,293 Points

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

Dmitry Polyakov
Dmitry Polyakov
4,989 Points

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

Christopher Ruiz
Christopher Ruiz
1,293 Points

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

Dmitry Polyakov
Dmitry Polyakov
4,989 Points

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