Learn HTML by Building a Cat Photo App - Step 15

I’m not really sure what I’m missing as I’ve tried putting the a anchor in several different places. Including wrapping the img in the anchor, but the image then gets removed. I know it’s going to be something so simple too. Please let me know how I can move on and better understand what it is I’m doing with this code. The error that I’m getting is:

Sorry, your code does not pass. Hang in there.

You should only add one opening anchor (a) tag. Please remove any extras.

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

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

<!-- 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/109.0.0.0 Safari/537.36

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

Link to the challenge:

1 Like

Look at the other link you have already created in the p element. Do you notice a difference between its href attribute and yours?

Also, a link needs both an opening and closing a tag. Again, look at the link you have already created to see how it is done.

1 Like

There is a target attribute in my first (a) link. However, when I target the img I get the same error. I could very well be inputting it incorrectly.

1 Like

The error message is saying that you have more than one opening anchor tag (<a>), which is causing an issue. To fix it, you can wrap the image in the existing anchor tag

The instructions don’t ask you to add a target attribute to the new link you are creating so I would just remove it. The only attribute you need on the new link is href.

1 Like

Thank you, I knew it was going to be something so simple. I appreciate your help

1 Like

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