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 trialWiner Raymond
Courses Plus Student 302 PointsPictures not showing!! Please Help!!
Ok, I'm doing everything that Nick is telling me but when I put in the exact lines of code to bring up the photos, such as the <img src="img/logo.gif" alt="Smells Like Bakin">, or the <img src="img/you-bake-me-blush.gif" alt="You Bake Me Blush">, my pictures aren't showing on the site. Is this because I have the unregistered version of Sublime or is it because my pictures are in the wrong place? I'm on internet explorer but I've also tried google chrome. Same thing. Is anyone else experiencing this problem?
6 Answers
Sukhraj Grewal
10,554 Pointsit must images in different folder and you selecting the image source as something else. if you show the code then we can tell you better
John Breiner
6,918 PointsUnregistered version of sublime wouldn't be the issue. I'd check the location of the pictures. If the path isn't exactly correct, then they won't show.
Winer Raymond
Courses Plus Student 302 PointsThanks for the swift reply. I tried copy pasting the code into my message but I'll have to spell it out I guess. The first one is <img src="img/logo.gif" alt="Smells Like Bakin">. Maybe I'm putting the pictures in a different path. I'll try that.
Gunjeet Hattar
14,483 PointsWell just make sure about a few things first
Lets assume you are creating your html project in a folder called Demo and you have your main html file called main.html in the same folder demo.
In the same folder you have your image file called image.jpg
So to call your image i.e. image.jpg in your main.html file you will use the tag
<img src="image.jpg" alt="alt_text" />
If you have your image files in a subfolder called images inside your Demo folder then you will refer to the image as given below. Subsequently add the preceding parent folders name in front of the child, followed by a forward slash / if your image files are two or three folders deep
<img src="images/image.jpg" alt="alt_text" />
// OR if your images are stored in a deeper level of folder structure then use this notation
<img src="parent_folder/child_folder/images/image.jpg" alt="alt_text" />
Try looking into your html code too. Maybe you spelt something wrong (it is case sensitive) or forgot to close the tags.
If it still doesn't work you can post your code here so that we can look into it.
Hope it helps
Winer Raymond
Courses Plus Student 302 PointsThat's what I figured, I just didn't know how to look deeper into a folder. I will try this method. It seems like it'll work. I'll keep you posted my friend. Thanks.
alex bacall
453 PointsAlso running into the same problem.. Here's my code from the Text editors and HTML class:
<img src="img/logo.gif" alt="Smells Like Bakin">
Using TextMate and Safari.
From the above response, I noticed a /> at the end. It's not in the video, and I tried it to see if it helps, but nothing changed.
My html file is in the same folder as the img folder.
EDIT: Nevermind. I realized I had 2 different html files, one in a different folder. Moved the img file into the correct folder and all is well.
Gunjeet Hattar
14,483 PointsGreat that you figured out. Well just to clear you on the /> at the end of the img tag. In html 5 the use of /> at the end of single tags is omitted. So previously used tags like <br /> in html 5 becomes <br> and <img src="" alt"" /> becomes <img src="" alt=""> and similarly. I have't started with the html track in treehouse so I used the older html 4 tags where they use /> at the end. Hope that explains
alex bacall
453 PointsThanks for clearing that up.