Learn HTML by Building a Cat Photo App - Step 15

Tell us what’s happening:
I’m not sure where to add the anchor element

Your code so far

<html>
  <body>
    <main>
      <h1>CatPhotoApp</h1>
      <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>
      <img src="https://cdn.freecodecamp.org/curriculum/cat-photo-app/relaxing-cat.jpg" <a href="https://freecatphotoapp.com"></a> alt="A cute orange cat lying on its back.">
    </main>
  </body>
</html>

Your browser information:

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.0.0 Safari/537.36

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

Link to the challenge:

You want to put the a tags around the img tag. You have put the a tags inside of the img tag.

As @bbsmooth said. You have put the a tags inside the img tag.

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

Now if we get rid of the src and the alt attributes (just for the purpose of explaining why the placement of the a tag is wrong) the code looks like this:
<img <a href="https://freecatphotoapp.com"></a> >

If you want an image to redirect you to an URL you need to wrap that image (img element) in an <a></a> tag, but the way you did it the other way around.

Good luck!

1 Like

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