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

what am i doing wrong?

i cant figure out how to get past the part where your supposed to add 'cupcake.jpg'

2 Answers

To add an image with html you would use

<img src="image1.jpg">

in your index.html file.

If this image is in a folder (called img in this case) and that folder is in the same location as your index.html file you would need to use

<img src="img/image1.jpg">

That's the basics of adding an image, it can get a little more complicated depending on where the image is in relation to the html file. Check out this article for a good explanation on file paths.

Hope this helps if not please post your code so we can take a look :)

Larry Goodhue
Larry Goodhue
4,246 Points
<img src="img/cupcake.jpg" width="[insert width here]" height="[insert height here]" alt="Cupcake"> 

Like James said, we would appreciate if you would share your code so we can identify the problem further. :)