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 How to Make a Website Creating HTML Content Structure the Image Gallery

Kunal Patel
Kunal Patel
793 Points

Structure of Image Gallery Question

After the Structure of Image Gallery Video, I typed the exact code in the video into my workspace and the image still doesn't show up when I view the page. I have my folder titled, "img" too. What did I do wrong?

I typed img src="img/numbers-01.jpg" alt="" within the <>.

Can you provide the code that you tried?

Kunal Patel
Kunal Patel
793 Points

img src="img/numbers-01.jpg" alt="" within the <> (Can't copy and paste code here).

John Steer-Fowler
John Steer-Fowler
Courses Plus Student 11,734 Points

Hi Kunal Patel,

You are able to paste code here: Please refer to the Markdown Cheatsheet below the answer textbox when posting an answer.

img src="img/numbers-01.jpg" alt=""

Please make sure that when you have downloaded the image files, they come in a zip file. You need to extract these files into your img folder and ensure they are named exactly 'numbers-01.jpg'. Not things like 'number-01.jpg' or even 'numbers-01.jpeg'

Hope this helps

Kunal Patel
Kunal Patel
793 Points
 <li>
   <a href="img/numbers-01.jpg">
    <img src="img/numbers-01.jpg" alt="">
    <p>This is the first image.</p>
  </a>  
</li>

1 Answer

John Steer-Fowler
PLUS
John Steer-Fowler
Courses Plus Student 11,734 Points

Hey Kunal Patel,

So on your code, you do not need to have the <a href="img/numbers-01.jpg"> linking to the image. Href is used to link to a url rather than an image.

There is nothing that I can see wrong with your image source. Like I mentioned in an above answer, perhaps check to ensure you have the image located within the img folder and correctly named. Watch out for image files ending .jpeg, they should be .jpg.