Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

HTML Build a Simple Website Text Editors and HTML Images and Lists

Ryan Harder
Ryan Harder
1,384 Points

Why only img/logo.gif instead of the full filename?

Why doesn't Nick have to type in the full filename of the logo? I tried it out on mine and it also worked, but I don't understand why. Is it because it's in the same folder as the index.html?

1 Answer

Richmond Lauman
Richmond Lauman
28,793 Points

The file path works in this case because the img folder (which contains the logo.gif file) is located in the same folder as the index file (the root folder). As long as the path is relative to the root of the site where the index file resides, it will work.

When you refer to the "full file name" are you referring to a path like "C:\Users\Richmond\Documents\Web Page Project\img/logo.gif"?

If that is what you meant, you should not use that kind of file path for a website.

Ryan Harder
Ryan Harder
1,384 Points

I see. I didn't realize that the location of the index made a difference. Thanks for clarifying.