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 Introduction to HTML and CSS (2016) HTML: The Structural Foundation of Web Pages and Applications Test: Creating an HTML Element

Shiva Lowy
seal-mask
.a{fill-rule:evenodd;}techdegree
Shiva Lowy
Full Stack JavaScript Techdegree Student 3,240 Points

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

index.html
<!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
Justin Warren
7,805 Points

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

https://www.w3schools.com/TAGS/att_img_alt.asp

Steven Parker
Steven Parker
231,269 Points

Justin 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
Steven Parker
231,269 Points

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

Daniel Bell
Daniel Bell
17,178 Points

You 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!