HTML HTML Basics Images, Text and Links Understanding File Paths

Steven Barrett
Steven Barrett
956 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.

Acatrinei Leonard Cezar
Acatrinei Leonard Cezar
2,231 Points

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

Dmitry Polyakov
Dmitry Polyakov
4,950 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,950 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,950 Points

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