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 Styling Web Pages and Navigation Style the Portfolio

Aditya Raj
Aditya Raj
715 Points

when adding photos other than what is there already in the project file, it doesnt show then why?


1 Answer

Zakk George
Zakk George
4,550 Points

Because your document doesn't have a place for reference to find the photo. I'll give you a couple of ways you can get a photo to work.

-First- Have the photo in the same file tree as your project. For example, if your image (kitten.jpg) is in your project all you have to do is write:

<img src="kitten.jpg">

-Second- Lets say you have that same photo in a folder solely for the images related to your project, (lets call it IMG), in the same folder. Then you have to specify the rout your computer should take to find the photo like this:

<img src="IMG/kitten.jpg">

-Finally- This last method requires internet in order for the image to display, because you will be copying an images URL and using that as the source instead. Google Kittens, find the picture you want, right click it, and select: "Copy Image Address". After thats done. head back to the document and paste it into the "src" attribute like this:

<img src="https://pbs.twimg.com/profile_images/562466745340817408/_nIu8KHX.jpeg">

Hope this helps and good luck!