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

Stuck On: Build a Simple Website @ Text Editors and HTML "Image error path

Hi I'm stuck on code challenge: Image and List. The problem that I'm having is that the image file can't be located. I copied the tag word for word and still have a problem. The img folder that i download was saved to a folder within three other folders so i moved to the img folder to the desktop thinking that would help the browser locate the source. I've had no success.here is the tag <img src="img/logo.gif" alt="Smells Like Bakin"> Are there any suggestions

Hi I'm still having trouble with the image path. I'm using sublime2 and I saved the project file under the name" index.html" I moved the img folder to the same folder as the saved project. I copied the index.html file and dragged it to a blank web page and it displayed the words and image correctly.The problem that I'm having now is that when i try to complete the challenge the image doesn't show it still tells me to check the image path.

3 Answers

Sounds like you are having issues with file paths, check out this tutorial on absolute vs relative paths

sorry for taking so long to get back at you but thanks that helped a lot

Your img folder needs to be in the same folder as the file you are trying to run.

  1. Create a folder on your desktop name it whatever you want
  2. Save index.html and style.css and any other webpages into the same folder
  3. Place your images inside of that folder

This keeps things very organised and easy to navigate :)

I perfer to put my CSS, images & javascript each in their own folders like this

source: http://css-tricks.com/quick-reminder-about-file-paths/

This is how I have mine set up, but as a beginner I found it easier to have things outside of folders.

When learning basic html+css its easy to forget the /images/image.jpg for me anyway it was easier just to type /image.jpg especially when I was using a very limited number of images just to get the hang of things.

But you are correct, that is a much better way to do things.