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 trialSteven Barrett
1,382 PointsWhy 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
3,669 PointsYou'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.
Acatrinei Leonard Cezar
2,239 PointsIm using "../../index.html" and it still not working ?!
Dmitry Polyakov
4,989 Points../ takes you one level up... ./ - the same directory
Alp Mumcu
Front End Web Development Techdegree Student 835 PointsI just used "/index.html" instead of ../..index.html and it worked too
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
4,989 Points../..index.html - this is wrong syntax. Two dots can only go before forward slash taking you one level up.
Christopher Ruiz
1,293 PointsWhat is the proper way to get back to the root folder? /index.html?
Dmitry Polyakov
4,989 Points/ - just forward slack will take you to the root folder ./ - your current folder ../ - one level up