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

Text 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

The way it works is that you have to put your images in the correct folder relative, to your HTML file.

Here's an example:

file directory structure example

Does that help?

If not, you can read up about absolute vs relative paths

thank you got it!

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>

The forum uses markdown to correctly format code, check out this thread on how to type code in the forum for some examples.

thank you James...will do

Hi,

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?

Hey 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>

How does your image link look like?

eg. <img src="myimgfolder/myimg.jpg">

<img src="img/logo.gif" alt="Smells Like Bakin">

Did you download the project files for the course? I ask cause i'd like to know the hierarchy of the files

this is the property of the file: C:\Users\David Marchman\Desktop\img\websitewaters-island01-stage01\img

Does that help?

Yes. And what about your index.html file?

C:\Users\David Marchman\Desktop\web

Oh 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.

I will try :)

thank you :)

You're welcome! :)

Sorry I don't know why my mark down isn't working

here let me try again lol

<img src="myfolder/myimg.jpg">