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

CSS How to Make a Website Styling Web Pages and Navigation Style the Portfolio

One of my photos is showing up as a question mark on the website. All the code is the same. What's wrong?

Back when we uploaded the photos for the practice website, I resized and uploaded my own. All came out fine, except for one. I went over all the code and it's exactly like the others. What am I missing?

Hi Sue,

Can you post your code please and we'll take a look?

Thanks

-Rich

Hi Rich,

Thanks for your help! Here's the code:

            <a href="img.web4.jpg">
              <img src="img/web4.jpg" alt="">
              <p>Perfect Pumpkins</p>
            </a>
          </li>

I checked in the image file and this picture is the same size as the others.

Thanks, Sue

4 Answers

daviem
daviem
21,118 Points

Hi Sue,

That top anchor link doesn't look right, should it not also be img/web4.jpg"> or something rather than img.web4.jpg? Perhaps that's messing with things?

Thats my best(only) guess :)

Hi Sue,

The only thing I can see wrong with the code is as David mentions above:

<a href="img.web4.jpg">

This href would need to be img/web4.jpg instead but if you're referring to the image displayed on the page itself it probably won't affect it.

The only other things I can suggest is to check for spaces in the image name, check the file format is .jpg and double check the image is located in the img folder.

Hope that helps

-Rich

Hi David,

Thanks for the idea. I tried changing that, but to no effect. The other 5 photos are set up the same way and do work. The only difference with this photo is the KB size. It's 188 and the others are over 300. Would that make a difference?

Aha!! When I went back into the image folder to check for spaces as Rich suggested, I noticed that the image name ended in JPG (capitals instead of lower case). I changed the lower case letters to upper in the code above and it worked!

Thanks guys!

No problem, glad you got it sorted!

-Rich

daviem
daviem
21,118 Points

ahh cool, nice one!

daviem
daviem
21,118 Points

eek,

Would you mind posting more of the code, perhaps the full unordered list? Other than typos in the code, and as Rich said, making sure the file path and img type (jpeg, png etc) are all spot on, it's hard to spot the problem.

cheers