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

Jack Cummins
Jack Cummins
17,417 Points

Why is this not working?

The prompt is "Inside the <body>, display the image moon.jpg located inside a folder named img."

The error is: "Make sure you specify that 'moon.jpg' is located inside the 'img' folder."

Why won't this work.

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

  </body>
</html>
Michael Sraj
Michael Sraj
23,188 Points

There are 2 issues that I see here, and trust me, I've been where you are so I definitely get it. One is that the img tag isn't located between the body open and close tags(between <body> </body>). The second thing to notice is that the image source doesn't reference the img folder. It would look something like this <img src="img/moon.jpg">. Depending on where the image folder is located, you may require futher markup in front of img/moon.jpg

3 Answers

Alejandro Narvaja
Alejandro Narvaja
Courses Plus Student 7,340 Points

The idea was to explain to you why it happens and not show the solution immediately. Although Michael explained it much better :)

Jack Cummins
Jack Cummins
17,417 Points

That doesn't help me.

Alejandro Narvaja
PLUS
Alejandro Narvaja
Courses Plus Student 7,340 Points

Because you need to specify the img folder where the image is located.