Learn HTML by Building a Cat Photo App - Step 15

I’m having trouble turning the cat picture into a link. It keeps on saying my anchor element should have an opening tag, but I don’t know how or where to put it.

Your code so far

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

If you want to turn something into a link, you simply enclose it between a pair of anchor tags. You shouldn’t edit the img element itself, but put an opening anchor tag directly before it and a closing anchor tag directly after. You can then add the necessary href attribute inside the opening anchor tag.

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