Learn HTML by Building a Cat Photo App - Step 14

Tell us what’s happening:
Describe your issue in detail here.
It keeps saying that I have an extra anchor tag. I have no idea where the extra anchor tag is. I come into this problem a lot.

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

User Agent is: Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.0.0 Safari/537.36

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

Link to the challenge:

Hi!

The error message is a little misleading, you don’t have an extra anchor element but it does not wrap the image correctly.

when you made the text ‘cat photos’ into a link you did it like this,

<p>Click here to view more <a target="_blank" href="https://freecatphotoapp.com">cat photos</a>.</p>

So to make the image into a link, you need to follow the same formatting style. The image needs to go between the opening and closing anchor tags.

<p><a target="_blank" href="https://freecatphotoapp.com"</a></p>

Should I include the text? I am still unsure what I am doing wrong. I know once I solve it, the answer will be obvious, but I am still unsure.

I’ve edited your post to make the code readable. To format code for the forum you need to put backticks around it, or highlight it and press the button that looks like this </>

This gif explains how to do those things visually.

Hi, no you do not need p elements for this or to add any text. Perhaps I could have phrased that better.

Your anchor element needs however to open and close correctly for this task. You’ve missed the opening tags brace.

The image element needs to go between the opening and closing anchor tags. So that the img element is inside the anchor element.

<p>Thanks so much</p>

Thanks for your help. I really appreciate it. I am still having a hard time getting this. Hopefully, I will figure it out.

<p><a target="_blank" href="https://freecatphotoapp.com"</a></p>

No problem! And I’m glad to see you’ve got the hang of formatting code. :smiley:

Have you tried anything new? This looks like the same code you showed me in your previous comment. Check my last reply, you still need to fix those issues I mentioned.

Thank you so much for your help. However, I have been on this for days. I think that I need to start over completely.

1 Like

Sometimes a fresh start does help.

You’re working really hard and your persistence will pay off, so keep at it! :smiley:

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