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 Build a Simple Website Text Editors and HTML Images and Lists

image path

I am trying to insert the Cupcake image into the body of my practice website but it is telling me to check the image path.

This is what I entered:

<img src="cupcake.jpg">

Help!

4 Answers

James Barnett
James Barnett
39,199 Points

Chris Passavia -

Step 2 of the code challenge you linked to:

> We've placed an image named 'cupcake.jpg' in a directory named 'img'.

You didn't reference the directory in your code.

Try...

html<img src="img/cupcake.jpg">

The image files you downloaded were in a folder called img.

You probably don't have the correct path. Where is your 'cupcake.jpg' image located? Is it within a folder (ie 'images/cupcake.jpg')?

hey chris. for the tutorial on the website your image is located in a file next to your index.html for example. if you had a folder called website and inside that folder you had your index.html your image is in a folder next to your index.html called img and inside that folder is your images. ive tryed to draw a small example: where [] = folders and ()=files

[WEBSITE] --> (index.html) [img][css] [img] -- > (cupcake,jpg)

So to locate the image you have to tell the index exactly where to go currently your doing this : <img src="cupcake.jpg"> witch basically = this result [WEBSITE] --> (index.html)[img][css] -- searchs for cupcake.jpg and can't find it. your asking it to find a file the doesn't excist because its in the img folder so to fix it we just add a directory change: <img src="img/cupcake.jpg"> witch = this result [WEBSITE] --> (index.html)[img][css] -- searchs and opens [img] [IMG] --> searchs for cupcake.jpg -- if the image is there it loads it

hope this help