Step 14 is confusing me

Step 14

Turn the image into a link by surrounding it with necessary element tags. Use https://freecatphotoapp.com as the anchor’s href attribute value.

When I click on the image, it says: Normally this link would bring you to another website! It works! This is a link to: (https://freecatphotoapp.com/) in a pop up.

What is wrong?

  **Your code so far**
<html>
<body>
  <h1>CatPhotoApp</h1>
  <main>
    <h2>Cat Photos</h2>
    <!-- TODO: Add link to cat photos -->
    <p>Click here to view more <a target="_blank" href="https://freecatphotoapp.com">cat photos</a>.</p>
    <a href="https://freecatphotoapp.com"</a><img src="https://cdn.freecodecamp.org/curriculum/cat-photo-app/relaxing-cat.jpg" alt="A cute orange cat lying on its back.">
  </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/102.0.0.0 Safari/537.36

Challenge: Step 14

Link to the challenge:

The anchor element here is malformed.

  1. The image element needs to be between the opening and closing anchor tags to turn the image into a link

  2. You need a closing > on your opening anchor tag, like you have on the line above.

2 Likes

This part is wrong:

You should put the img inside the <a> like this: <a ...><img ...></a>

3 Likes

so I’m close to getting it but my link doesn’t link in the anchor element. What should I do here

href="https://freecatphotoapp.com A cute orange cat lying on its back.

NVM i got it!

1 Like

Thank you. The explanation helped me!

1 Like

hi there, I’ve followed the same step here, but still, I couldn’t get it. here’s my code:

<html>
<body>
  <h1>CatPhotoApp</h1>
  <main>
    <h2>Cat Photos</h2>
    <!-- TODO: Add link to cat photos -->
    <p>Click here to view more <a target="_blank" href="https://freecatphotoapp.com">cat photos</a>.</p>
  <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>
  </main>
</body>
</html>

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