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 HTML Basics Images, Text and Links Images and File Paths Challenge

Kim Hyunsung
Kim Hyunsung
6,555 Points

I wrote img tag exactly in between <body> </body> tags and preview also showed image but work keep bummer.

I wrote img tag exactly in between <body> </body> tags and preview also showed image but work keep bummer.

index.html
<!DOCTYPE html> 
<html>
  <head>
    <title>The Moon</title>
  </head>
  <body>
    <img src="./img/moon.jpg">
  </body>
</html>

1 Answer

Sam Glister
Sam Glister
1,704 Points

Hi Kim,

The issue with your code is with how you have written the path.

So you index.html file is at the root of the project and then the moon.jpg is located one folder deeper in the img folder.

As its only going deeper you don't need './' at that start of the path.

The result should be that your HTML should look like this:

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