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 Introduction to HTML and CSS (2016) Adding a New Web Page Write the CSS

Ted Kondev
seal-mask
.a{fill-rule:evenodd;}techdegree
Ted Kondev
Front End Web Development Techdegree Student 2,254 Points

Introduction to HTML/ Image not displayed

Hi. I have a persisting problem with my code. I did not want to follow the instructor and upload a random image, so I went ahead and uploaded an image of myslef ("JPG" (.jpg) 400px by 400px) on the workspace and the created a path for the image in my image ellement. Code is as follows: <img src="images/myproject.jpeg" alt="Teodor Kondev, Web Developer"> The alternative text is visible however the image fails to display.

https://w.trhou.se/yabqv8kmzl

1 Answer

Bella Bradbury
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
Bella Bradbury
Front End Web Development Techdegree Graduate 32,790 Points

Hello Ted!

As I see it in your forked workspace, your myproject.jpeg image isn't stored in the images folder. You'll want to review your routing. As you currently have the route set to images/myproject.jpeg, your html code is first looking in the images folder and then trying to find a file named `myproject.jpeg. There is no such file in the images folder though.


To fix this, you'll either need to:

  • Take the images/ text out of your route

OR

  • Put the image file into the images folder

When it comes to writing out routes to files, you can think of it as "What folders did I have to click to get to this file from the other one?"

Hope this helps!

Ted Kondev
seal-mask
.a{fill-rule:evenodd;}techdegree
Ted Kondev
Front End Web Development Techdegree Student 2,254 Points

Thank you ever so kindly. The problem is now fixed. For some reason I thought that the image file was saved in the image folder. Thank you for taking the time to help me out!

Bella Bradbury
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
Bella Bradbury
Front End Web Development Techdegree Graduate 32,790 Points

Absolutely! If you're satisfied with my answer you can go ahead and click "best answer" to close out this discussion. It's just a way of letting others know that this question is resolved, this discussion will still be available!