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 trialIngrid Bardales
10,616 Pointsadding image
I feel soo dumb, I'm trying to build a small site for a friend and NOTHING is going right, what a horrible feeling! I've done this tons of times before but this time it's not working, I'm trying to add an image of a doghouse but i don't see it when i compile it. could you guys please help~
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>The-Pet-and-Grooming-House</title>
<link rel="stylesheet" href="normalize.css" type="text/css">
<link rel="stylesheet" href="main.css" type="text/css">
</head>
<body>
<div class="main-wrapper">
<div class="main-header">
<header>
<h1>The Pet House</h1>
<img src="pics/doghouse.png" alt="doghouse">
15 Answers
Dustin Matlock
33,856 PointsYour HTML files should be one folder up.
Suleyman Kolanci
Courses Plus Student 13,741 Pointscan you submit your code?
Ingrid Bardales
10,616 Pointsgot it!
Erik McClintock
45,783 PointsIngrid,
Your code looks fine, as far as calling in an image goes. Have you verified that the filename, location, and extension are all correct?
Erik
Ingrid Bardales
10,616 PointsMy root folder is TheHousePet then i have the Pics folder and inside there i have the doughouse.png
Erik McClintock
45,783 PointsIf this HTML file and the Pics folder both live in the same root folder, then your path is correct. Next up is to check that spelling and capitalization for both the folder and the image itself are correct.
Erik
Erik McClintock
45,783 PointsSo what I've put below is the correct folder structure and spelling/capitalization of everything?
TheHousePet (folder)
->index.html (file you're trying to call the image from)
->pics (folder)
->->doghouse.png
Erik
Ingrid Bardales
10,616 PointsThanx Erik
Suleyman Kolanci
Courses Plus Student 13,741 Pointswell from what i see you need to get the right html structure first
<!DOCTYPE html> <html> <head></head> <body> <img src="url("img/example.jpg)"/> </body> </html>
Ingrid Bardales
10,616 PointsIsnt that what i have?
Erik McClintock
45,783 PointsIngrid,
This answer may have been posted prior to your code being posted correctly. Your doctype declaration is correct.
Erik
Dustin Matlock
33,856 PointsHi Ingrid, make sure your image is located (spelled exactly—case sensitive ): pics/doghouse.png
.
Ingrid Bardales
10,616 PointsHey Dustin, yes I've doubled and triple check and it's just as you have it And i have it in my code
Dustin Matlock
33,856 PointsCan you zip the project and upload it to Dropbox or a similar service?
Ingrid Bardales
10,616 Pointsok, Dustin, I'm going to open an account in Dropbox
Ingrid Bardales
10,616 PointsHi Dustin, I uploaded my file to Dropbox, how do i invite you?
Dustin Matlock
33,856 PointsIngrid, try this link.
Ingrid Bardales
10,616 Pointshttps://www.dropbox.com/sh/xl3lofdbutwsg89/AADWh8nmUpGo7i4l8pGGnMLKa?dl=0
ok, Dustin, here is the link. Thanx!
Ingrid Bardales
10,616 Pointsok, i moved the HTML files one folder up
Dustin Matlock
33,856 PointsThat's it. Should be working.
Ingrid Bardales
10,616 PointsShould i have changed my HTML? I tried to re-view it in Sublime but i get the broken image icon again.
Ingrid Bardales
10,616 PointsOK OK OK!!!!!! I GOT IT!!!!
<h1>The Pet House</h1>
<img src="../pics/doghouse.png">
</header>
Ingrid Bardales
10,616 PointsAWWW Dustin thanks!!! Is this the way i should order my folders from now on?
Dustin Matlock
33,856 PointsGenerally, I would recommend something more like this. Also, be careful with capitalization of file names and directories. Most web servers are Linux, and so that matters. Glad you got it worked out!
Ingrid Bardales
10,616 Pointsok got it, thanks so much!
Dustin Matlock
33,856 PointsYou're welcome. Good luck with the website.
Ingrid Bardales
10,616 PointsIngrid Bardales
10,616 PointsHi Dustin, it's me Ingrid again. I was wondering if you could me with two more things on my site? If you don't have time i understand. But if you go I am so greatfull! I downloaded two fonts, added my @font-face and changed the name and made sure i used it when i called it in my h1 declaration but i don't see anything. Second issue is my navigation, i can't get it to set it to the full width and height of the .main-wrapper, I've tried and no results. Let me know what i need to do just like before. By the way i followed you on twitter, I'm olmc1. like i said if you don't have time, I will understand. But if you do THANK YOU!!! and i've provided the link to dropbox below. Please feel free to critique and give any tips or suggestions.
Thanx a million in advance! Ingrid
https://www.dropbox.com/sh/xl3lofdbutwsg89/AADWh8nmUpGo7i4l8pGGnMLKa?dl=0