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
Yordan Sanchez
2,384 PointsMy 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.
Jacki Bobbie
Courses Plus Student 3,138 Pointssorry, my code didnt show off... here I am trying again : <img src="example.jpg">
Jacki Bobbie
Courses Plus Student 3,138 Points"<img src="example.jpg">"
but in that way, your example.jpg should be in the same directory as your .html page.
Yordan Sanchez
2,384 PointsI 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">.
Jacki Bobbie
Courses Plus Student 3,138 Points" <img src="example.jpg"> "
Jacki Bobbie
Courses Plus Student 3,138 Points" <!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
Jacki Bobbie
Courses Plus Student 3,138 Points" <img src="example.jpg"> "
Yordan Sanchez
2,384 PointsI downloaded the video file and the format of the img is logo.gif
Jacki Bobbie
Courses Plus Student 3,138 PointsClick on here
Suli S
1,475 PointsDon't forget to check spellings and don't forget the second part of the angle brackets < >
Yordan Sanchez
2,384 PointsI have checked everything, the code looks right but the img does not show up in the browser.
Suli S
1,475 PointsTry another browser and give us a screenshot of your HTML markup if it is possible.
Yordan Sanchez
2,384 Pointshow do I make a screen shot in the mac with sublime text. I am a new mac user.
Suli S
1,475 PointsYordan Sanchez
2,384 PointsHere 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>
Randy Perez
5,668 PointsThis 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>
Jacki Bobbie
Courses Plus Student 3,138 PointsJacki Bobbie
Courses Plus Student 3,138 PointsFirst, 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..