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

going back to index.html from the 2017 articles.html

instead of ../../ i did /../ and it works the same. Hope i can do this and it is correct?

2 Answers

John Lack-Wilson
John Lack-Wilson
8,181 Points

Hey Ishita, they're not quite the same - although they could both be right, depending on the situation.

/ usually indicates the root directory

./ usually indicates the current directory

../ usually indicates the directory above the current one

Therefore, ../../ means to go up two levels of the directory structure. I would always recommend being very specific about which directory to avoid any errors.

ok, so even though i am getting the same it is best to do ../ twice (or as needed) in order to avoid mistakes?

John Lack-Wilson
John Lack-Wilson
8,181 Points

Yeah exactly, it’s always best to be explicit with your intentions in code