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 trialShiva Lowy
Full Stack JavaScript Techdegree Student 3,240 PointsHaving some trouble
I am trying to add this tag. Maybe I am putting it in the wrong spot? If anyone has any advice that would help so much.
<!doctype>
<html>
<head>
<title>My trip to Spain</title>
</head>
<body>
<img alt="A picture of me in Spain"> <img src="images/spain.jpg">
Here is a picture of me in Spain last summer!
<a>Go back to the top of the page.</a>
</body>
</html>
Justin Warren
7,805 PointsSo a couple of quick things to help out!
At the top of the page you will want to start the document with
<! DOCTYPE html>
And for the alt tag you can write it like this:
<img src="images/spain.jpg" alt="A picture of me in Spain">
So the src and alt tag are in the same brackets. Hope this helps!
Also here is an extra resource to help too.
Steven Parker
231,248 PointsJustin Warren — I agree that the "doctype" tag is peculiar, but that's the way the challenge supplies it (and it is not checked).
But you might want to report it as a bug to Support.
2 Answers
Steven Parker
231,248 PointsThe instructions say "Give the image tag a src attribute...", so you'll want to add the src attribute to the tag that is already there. You don't want to create a second img
tag.
Shiva Lowy
Full Stack JavaScript Techdegree Student 3,240 PointsThank you Steven. I understand now. :)
Daniel Bell
17,178 PointsYou have:
<img alt="A picture of me in Spain"> <img src="images/spain.jpg">
It should be:
<img alt="A picture of me in Spain" src="images/spain.jpg">
SRC and ALT are attributes on the same tag. Your first IMG tag has no image file linked to it!
Shiva Lowy
Full Stack JavaScript Techdegree Student 3,240 PointsShiva Lowy
Full Stack JavaScript Techdegree Student 3,240 PointsThat makes so much sense now!! Thank you for the explanation. It is much appreciated.