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

coding problem

double check your img path

7 Answers

Steven Litton
Steven Litton
13,520 Points

You need to check that the path to the link is correct, the image is found from the html or css file you are calling it from. The root is the main directory of all your files. So if the image is in the same directory as the css file the path would just be 'example-image.jpg'. If the images are all kept within an image folder (for example 'images') you would need to specify the path with the folder name like this 'images/example-image.jpg'. Now if the file you are calling the image from is within a folder like a css folder then you may need to go up through directories using ../ eg ../example-image.jpg

Sometimes you may need to do both ../images/example-image.jpg

/folder-name/ (move in to folder) ../ (goes up one directory can be used multiple times for multiple directories) ../../../../

I hope this makes sense, you just need to know where your images is in relation to your HTML or CSS files that you are calling it in to.

i m not getting the image i mentioned the codes the path correctly my image comes like a small symbol but m not get the full image

Steven Litton
Steven Litton
13,520 Points

Which exact code challenge are you trying to complete?

upload an img cupcake.jpg stage 2 , coding test.

Steven Litton
Steven Litton
13,520 Points

Ok now they have an image they want to add to the site called cupcake.jpg and it is in a folder called img so you need to use an image tag within the body tags of the HTML to call it. <img src="cupcake.jpg"/> (This will not work because the image is in the img folder and not the root of the site) <img src="img/cupcake.jpg"/> (You will need to use this) I hope that makes sense.

Steven Litton
Steven Litton
13,520 Points

Ah sorry - you can't HTML markup in here. You need to target the image src using img/cupcaske.jpg

thank you it was really helpful