Learn HTML by Building a Cat Photo App - Step 15

I’m still struggling with where to place the anchor attribute

Your code so far

      <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 <a 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.">

Your browser information:

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

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

Link to the challenge:

Your anchor should wrap the img.
just like you did in the line above like this:

If you want to turn an image into a link follow this rule:

<a href="url"><img src="url"></a>

You have put the opening ‘a’ tag within the ‘img’ tag and forgotten to add the closing ‘a’ tag after the closing ‘img’ angle bracket.

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

I have tried that but it’s still not working

Add the closing angle bracket after the first URL. Add the closing ‘a’ tag at the end: </a>
Take another look at what I have posted above.

In addition to the missing closing tag you also left out the closing > bracket for the opening anchor tag

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