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
David Marchman
Courses Plus Student 1,497 PointsText Editors and HTML--Stage 2 Help(Noob)
I am going through the Build a Simple Website... and on stage 2(NOOB) I know... but my image keeps coming up broken when I enter the <img src="img/logo.gif" alt="Smells Like Bakin"> I am not using a mac.... any help?
Here's how my code looks: <!DOCTYPE HTML> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> <title> Smells like Bakin' Cupcake Company</title> </head> <body> <img src="img/logo.gif" alt="Smells Like Bakin"> </body> </html>
6 Answers
James Barnett
39,199 PointsThe way it works is that you have to put your images in the correct folder relative, to your HTML file.
Here's an example:
Does that help?
If not, you can read up about absolute vs relative paths
David Marchman
Courses Plus Student 1,497 PointsHere's how my code looks
<!DOCTYPE HTML> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> <title> Smells like Bakin' Cupcake Company</title> </head> <body> <img src="img/logo.gif" alt="Smells Like Bakin"> </body> </html>
James Barnett
39,199 PointsThe forum uses markdown to correctly format code, check out this thread on how to type code in the forum for some examples.
David Marchman
Courses Plus Student 1,497 Pointsthank you James...will do
Raissa de Guzman
645 PointsHi,
I'm not sure what you're trying to ask here, could you please give me more info? :) Are you trying to set the page title?
David Marchman
Courses Plus Student 1,497 PointsHey Raissa when doing the course I am trying to follow along with my external Sublime text 2 and every image I post comes up as a broken link image... everything else looks good on my html page, but all my picture links don't't appear, except for a broken link... so essiently my image link to my folder isn't connecting some how
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title> Smells like Bakin' Cupcake Company</title>
</head>
<body>
<img src="img/logo.gif" alt="Smells Like Bakin">
<ul class="nav">
<li><a href="#">About</a></li>
<li><a href="#">Cupcakes & Prices</a></li>
<li><a href="#">Locations</a></li>
<li class="last"><a href="#">Contact Us</a></li>
</ul>
<div id="intro">
<h1>Opposites really do attract, especially in our kitchen! We combine unexpected flavors that mel togethor to creat ironically delicious desserts</h1>
<p><a href="#" class="btn">Browse Our Cupcakes</a></p>
</div>
<img src="img/youyou-bake-me-blush.gif" alt="You Bake Me Blush">
<div id "featured-cupcake">
<h2>CUpcake of the Week</h2>
<p> This weeks featured cupcake is the <a href="#"Avacado Choclate cupcake</a> Its a strange combo of flavors will kick your tatse buds into fiesta mode</p>
<img src="img/featured-cupcake.jpg" alt="Avocado Choclate Cupcake"
</div>
</body>
</html>
Raissa de Guzman
645 PointsHow does your image link look like?
eg. <img src="myimgfolder/myimg.jpg">
David Marchman
Courses Plus Student 1,497 Points<img src="img/logo.gif" alt="Smells Like Bakin">
Raissa de Guzman
645 PointsDid you download the project files for the course? I ask cause i'd like to know the hierarchy of the files
David Marchman
Courses Plus Student 1,497 Pointsthis is the property of the file: C:\Users\David Marchman\Desktop\img\websitewaters-island01-stage01\img
David Marchman
Courses Plus Student 1,497 PointsDoes that help?
Raissa de Guzman
645 PointsYes. And what about your index.html file?
David Marchman
Courses Plus Student 1,497 PointsC:\Users\David Marchman\Desktop\web
Raissa de Guzman
645 PointsOh so that's why :)
You'll wanna move your img folder into the web folder. Your index.html file and all your file folders used in building the site must belong to the same folder. Otherwise, the links will not work.
David Marchman
Courses Plus Student 1,497 PointsI will try :)
David Marchman
Courses Plus Student 1,497 Pointsthank you :)
Raissa de Guzman
645 PointsYou're welcome! :)
David Marchman
Courses Plus Student 1,497 PointsSorry I don't know why my mark down isn't working
Raissa de Guzman
645 Pointshere let me try again lol
<img src="myfolder/myimg.jpg">

David Marchman
Courses Plus Student 1,497 PointsDavid Marchman
Courses Plus Student 1,497 Pointsthank you got it!