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

linking image on html

hi, i am new, i used the below codes, but my picture is not coming up? i checked the link location many times, but it seems to only show text Smells like Bakin but no picture

can anyone please help me,

<!DOCTYPE HTML>
<html>
<head>
  <meta http-equiv="Content-type" content="text/html; charset=utf-8"/>
  <title>Smells Like Bakin Cup Cake Company</title>
  </head>
<body>
  <img src="img/logo1.jpg" alt="Smells Like Bakin">
<ul>
<li><a href="#">About</a></li>
<li><a href="#">Cupcakes & Prices </a></li>
<li><a href="#">Location</a><li>
<li></li>
</ul>
</body>
  </html>

[ed. note] Added markdown to fix code formatting

15 Answers

Allison Grayce Marshall
STAFF
Allison Grayce Marshall
Treehouse Guest Teacher

Hey Nash, It seems you haven't provided us with the correct information to help you. Did you mean to copy and paste HTML code? Also, none of that contains any links to images.

Check out our markdown cheatcheat if you need help formatting the code in your post.

Allison

Hey Nash,

Firstly ensure you have a folder structure like this

Root (folder) -- img (subfolder folder) --CSS (subfolder folder)

if you want to add an image to you webpage insert the code below but make sure you type in the folder your image resides in.

The "Img" part of the src attribute represents the folder the image sites in.

<img src="img/you-bake-me-blush.gif" alt"you bake me blush">

hope this helps

Dear Forum,

I am also new, and seem to be having the exact same issue, I cannot get images to appear in a Chrome HTML document?

here is my code: (copied from the tutorial)

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

Any suggestions? Thanks!

James Barnett
James Barnett
39,199 Points

The 2 most common mistakes when images are not showing up are a typo with the file names or using the wrong file path.

So triple check that you are using the exact name of the image file in your HTML, if that doesn't resolve the issue, check the file paths.

Here's a quick primer on file paths that should get you going.

James Barnett
James Barnett
39,199 Points

Kevin -

Advice from your friendly neighborhood mod :tm: ...

Remember the rule of thumb when posting code on the forum your issue, your code, your thread.

Thank you so much James!

James Barnett
James Barnett
39,199 Points

Kevin - Glad you got your issue resolved internet high five

And thank you James for teaching me forum etiquette...I am so new to all this...

still working on resolving my image not showing up issue...

James Barnett
James Barnett
39,199 Points

Kevin -

I see you created a thread for your issue :smile:


And thank you James for teaching me forum etiquette...I am so new to all this...

You might also be interested in our featured post on how to ask good question on the forum

James, First, I now have successful images thanks to you! It was the file path. Second, I will immediately read, how to ask good questions on the forum. Thank you for your patience with me. I certainly wish to be a courteous member of this website. Best Regards, Kevin

James Barnett
James Barnett
39,199 Points

Kevin - So glad to you got it working :star:

hey matt sorry i feel so terrible bugging you on such a small thing,

i even tried giving it a size, its still not fetching it, when i used crome, it mentioned something about element , and another one that says display -in line block

i am getting little frustrated with myself, can you please help me

</head> <body> <img src="img/a.jpg" alt="Smells Like Bakin" height="42" width="42">

Skylar Dryden
Skylar Dryden
7,564 Points

Is your image in a img file?

Hey Nash,

Dont worry about the bugging part it's all part of learning.

in your code <img src="img/logo1.jpg" alt="Smells Like Bakin">

the jpg file is called logo1.jpg as the James highlighted the first common mistake is the miss spelling the file.

Triple check to.

if that's fine take a screenshot of your file structure, and then the img folder.

Regards