Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

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?

HTML and CSS

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!