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

James Coffin
James Coffin
238 Points

img tag question

Hello, I put the "smells like bakin'" folder on my computer. However when I put in the image tag <img src="../desktop/img/logo.gif" alt="Smells Like Bakin"> like this, the text editor asks for 2 dots in front of desktop in order for the tag to work. My question is what do those dots mean? Is that normal syntax? I tried this with multiple text editors and it's the same with all of them.

2 Answers

Ilja Daderko
Ilja Daderko
8,953 Points

The "../" means that you are jumping out of a folder to grab something for example if your web project is in a folder named "Project" and inside this folder you have "img" "css" "files" folders, We can assume that your html page is inside files folder. In order to get an image you will need to jump out of a "files" folder to get access to "img" folder (as it is outside), so in your html a path to an image should look like "../img/somefile.png" It sounds to me like you might be doing something wrong, as you should not encounter this problem, make sure to watch through videos again.

James Barnett
James Barnett
39,199 Points

Ilja Daderko -

:+1: Nice explanation of how relative paths work

James Coffin
James Coffin
238 Points

Thank you very much. That helped a lot!!