Learn HTML by Building a Cat Photo App - Step 15

I don’t know where to put the opening tag and whatever else i need to add to get past this step, its taking me so long to do these simple short lines of codes its embarrassing. The step is to turn the image of a cat into a link, any help is greatly appreciated.

<html>
  <body>
    <main>
      <h1>CatPhotoApp</h1>
      <h2>Cat Photos</h2>
      <!-- TODO: Add link to cat photos -->
      <p>See more <a target="_blank" href="https://freecatphotoapp.com">cat photos</a> in our gallery.</p>

<!-- User Editable Region -->

      <img <a target="_blank" href="https://freecatphotoapp.com"src="https://cdn.freecodecamp.org/curriculum/cat-photo-app/relaxing-cat.jpg" alt="A cute orange cat lying on its back."</a> >

<!-- User Editable Region -->

    </main>
  </body>
</html>

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/117.0.0.0 Safari/537.36

Challenge: Learn HTML by Building a Cat Photo App - Step 15

Link to the challenge:

When you turned the words “cat photos” into a link, where did you put the opening a tag? Where did you put the closing a tag?

You would do the same thing with the image. But instead of words, you are putting the tags around an img element.

i tried that but it did not work

Your anchor (a ) element should have an opening tag. Opening tags have this syntax: <elementName> . this is what it says

You’ll need to paste your updated HTML in here using the following method so we can see what you did.

To display your code in here you need to wrap it in triple back ticks. On a line by itself type three back ticks. Then on the first line below the three back ticks paste in your code. Then below your code on a new line type three more back ticks. The back tick on my keyboard is in the upper left just above the Tab key and below the Esc key. You may also be able to use Ctrl+e to automatically give you the triple back ticks while you are typing in the this editor and the cursor is on a line by itself. Alternatively, with the cursor on a line by itself, you can use the </> button above the editor to add the triple back ticks.

<img <a target="_blank" href="https://freecatphotoapp.com" src="https://cdn.freecodecamp.org/curriculum/cat-photo-app/relaxing-cat.jpg" alt="A cute orange cat lying on its back."</a>>

Again, look at how you created the “cat photos” link in an earlier step:

<a target="_blank" href="https://freecatphotoapp.com">cat photos</a>

Where did you put the opening a tag? Where did you put the closing a tag? It’s the same concept for turning an img element into a link, except that instead of wrapping the a tags around some words you are wrapping them around an img element.

Don’t change anything about the img tag. I would reset the step to get the original HTML back. You are only adding a tags around the img tag, not inside of it.

 <a <img src="https://cdn.freecodecamp.org/curriculum/cat-photo-app/relaxing-cat.jpg"</a> alt="A cute orange cat lying on its back."> 

i tried putting closing a tag at the end there and very end still not working

You are still changing the img element by inserting the closing a tag inside of it. This is the img element:

<img src="https://cdn.freecodecamp.org/curriculum/cat-photo-app/relaxing-cat.jpg" alt="A cute orange cat lying on its back.">

It should remain that way. Do not make any changes to it at all.

You want to put the a tags around the img tag.

Also, your opening a tag is not correct. Remember, a tag always starts with < and ends with >, so you need both on your opening a tag. And then you need to add the href attribute to your opening a tag as well.

Look at how you created the “cat photos” link to see how it is done.

 <a href="https://freecatphotoapp.com" > <img  src="https://cdn.freecodecamp.org/curriculum/cat-photo-app/relaxing-cat.jpg"alt="A cute orange cat lying on its back."></a> 

thank you for the help i finally got it i was really tired when i was working on it earlier sorry for not understanding the comments it was a simple step

1 Like

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.