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

My img it does not display in my browser when I refresh.

!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="#">Contac Us</a></li> </ul> </body> </html> I wrote this code in my text editor and when I refresh my Chrome the img does not display. Some help please.

First, your doctype html must be like this : <!DOCTYPE html>

to put an image on html page, you need to do it like this example :

same directory? <img src="example.jpg">

url? <img src="http://www.test.com/example.jpg">

etc..

sorry, my code didnt show off... here I am trying again : <img src="example.jpg">

"<img src="example.jpg">"

but in that way, your example.jpg should be in the same directory as your .html page.

I changed my DOCTYPE now it lookslike this: <!DOCTYPE html> and I also made sure that the img src is correct I wrote that part of the code againg but it did not work. I do not know what else to do.<img src="img/logo.gif" alt="Smells Like Bakin">.

" <img src="example.jpg"> "

" <!DOCTYPE html> <html> <head> </head> <body> <img src="example.jpg"> </body> </html> "

This is the minimal you should have put in your html page. If you write it like that, your example.jpg MUST be in the same directory as your .html page .

4 Answers

" <img src="example.jpg"> "

I downloaded the video file and the format of the img is logo.gif

Click on here

Don't forget to check spellings and don't forget the second part of the angle brackets < >

I have checked everything, the code looks right but the img does not show up in the browser.

Try another browser and give us a screenshot of your HTML markup if it is possible.

how do I make a screen shot in the mac with sublime text. I am a new mac user.

Here is my code : <!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="#">Contac Us</a></li> </ul> </body> </html>

This will work as long as the image is in the same directory than your webpage

<code> <!DOCTYPE html> <html> <head> </head> <body> <img src="yourimage.gif"> </body> </html>

</code>