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 trialMarlz Morgan
794 PointsI'm confused as to why "vr-user.jpg" has the following ../../ when the folder is not nested in subfolders?
Any one know why this is?
4 Answers
Steven Parker
231,271 PointsThe live URL to a workspace is temporary and only exists while you are using it. But you can use the snapshot function (the camera icon) to get a persistent link to it.
But even without seeing it, I can tell you that a "../../" prefix doesn't descend into a subfolder, but it is used to reference things from inside one. So it would make sense that if an image is being referenced, that the image would not be in a subfolder. But the page that is referring to it would be.
Marlz Morgan
794 PointsThis is the link for my workspace https://teamtreehouse.com/workspaces/40696621 I am referring to the following lesson: https://teamtreehouse.com/library/captioning-images
I am unsure why I have to add so many ../../ when it seems as though the image is contained in a folder that is not in a subfolder.
Marlz Morgan
794 PointsThanks this is the snapshot link (https://w.trhou.se/9pr1phkvef). Inside you will see the image I am referring to (vr-user.jpg) in the article.html file. The link for the image is <img src="../../img/vr-user.jpg" alt="user experiencing VR">
I have looked in a book for more clarity on this and the book describes the prefix as a 'Grandparent Folder'. In the video Guil states "We need to move out of the article and 2017 subfolders back up to the route, and then back down inside the image folder."
So as I am making a link from the articles.html file to the image file I have to use ../ twice to represent each of the folders e.g. 2017 and articles and then img/ to access the jpg file?
Sorry I am a newbie and I am really trying my best to fully understand all of this.
Thanks for your patience, I really appreciate your help.
Steven Parker
231,271 PointsIt sounds like you have the right idea. The code you're working with is in two nested subfolders and it is referencing an image file that is in the "img" subfolder of the main folder.
Marlz Morgan
794 PointsSteven, you're the man!
Much appreciated. I fully understand it now, thanks for your help.
It was really bugging me. I want to ensure I get the basic fundamentals, I'm learning.
Thanks again, brother.
Steven Parker
231,271 PointsYour dedication to thorough understanding is admirable and will surely serve you well.
Happy coding!
Steven Parker
231,271 PointsSteven Parker
231,271 PointsCan you provide a link to where you are seeing this?