Learn HTML by Building a Cat Photo App - Step 15

Tell us what’s happening:
Describe your issue in detail here.

I have turned the photo into a link by adding the link in an anchor tag. It won’t pass because it says my anchor tag requires a closing tag. When I add the closing tag, it says anchor ags don’t have closing tags. It is driving me nuts. I get that FCC forces to learn this way but this is one reason why CC is way more efficient

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 href="https://freecatphotoapp.com"
    </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/105.0.0.0 Safari/537.36

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

Link to the challenge:

Please post the hint text. I do not think you are understanding it correctly.

Hint

Your anchor (a) element should have a closing tag. Closing tags have a / just after the < character.

Very good. So which part of the code do you think this hint is referring to?

<a href=“https://freecatphotoapp.com

So this requires a closing tag ( /a> ) ?

Okay then you are understanding the hint.

Here is some sample code to show you the anchor tag again.

<a href=“website-address”>Click Me!</a>

As you can see, the anchor tag has an opening and closing tag and in between the text “Click Me!” Is what turns into a link. The href part is the website that the link will take you to.

Make you anchor look like this, but instead of Click Me! In the middle, the img tag will be there (as we want the image to be clickable now)

1 Like

Thanks so much for explaining so nicely!

<img src=“https://cdn.freecodecamp.org/curriculum/cat-photo-app/relaxing-cat.jpg” alt=“A cute orange cat lying on its back.”>

Hint

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

it’s still not working

I’m not sure if i’m allowed to post the answer here? I can delete it if it’s against the guidelines…

we don’t want people to post answers on the forum. Actually all of the answers are available online but we want the forum to be a place were people who want to learn to code can come and learn to do that without being pushed into copying solutions because that is all they find here.

(I should also tell you that marking a post as ‘solution’ on the forum doesn’t mean that it contains the solution code. It just means that the post gave you what you needed to solve the problem)

The answers are available online in general or on Codecamp?
I understand that the solution button is just to say which reply solved the issue, the way yours was helpful, so I get that…

i mean that there are solutions to fCC steps online if you search (video walkthroughs etc).
(not here)
Also if you google any of these elements you are working on, you can find many examples that can also give answers on this.

1 Like

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