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 trialAlex Pascoe
1,595 PointsBrowser won't display images. Code seems fine, only seeing a small error box in place of image. Any ideas?
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>Alex Pascoe | Photographer</title> </head> <body> <header> <a href="index.html"> <h1>Alex Pascoe</h1> <h2>Photographer</h2> </a> </header> <section> <ul> <li> <a href="img/numbers-01.jpg"> <img src="img/numbers-01.jpg" alt=""> <p>A picture</p> </a> </li> </ul> </section> <footer>Ā© 2016 Alex Pascoe</footer> </body> </html>
4 Answers
anil rahman
7,786 PointsNot sure but try putting the a tag around the image tag such as this:
<a href="img/numbers-01.jpg"><img src="img/numbers-01.jpg" alt=""></a>
Also to make sure that the src path is not wrong you can try using ../
<a href="../img/numbers-01.jpg"><img src="../img/numbers-01.jpg" alt=""></a>
Alex Pascoe
1,595 PointsImages are already in an image folder on the same level as the index.html.
Is the file path wrong? It looks good.
Roger Schaeffer
2,144 PointsYour file path appears to be correct but I can't be sure without a screen shot of your directories.
Also make sure your spelling AND capitalization match the file name character for characte (file names are case sensitive).
If that doesn't help then put ../ in front of img Anil suggested.
Alex Pascoe
1,595 PointsSolved,
Images folder had a capitalized 'i', file path didn't.
Little things. Thank you for your help everyone. I'm sure I'll need a lot more.
I appreciate it,
Roger Schaeffer
2,144 PointsRoger Schaeffer
2,144 PointsIf you have not already, you need to create an "img" folder in workspaces and then move all the image files into the "img" folder. If your images are not in the "img" folder then your html will not find those pictures because they haven't been placed there yet.