Step 14 Cat App need help

This is the task: Step 14

Turn the image into a link by surrounding it with necessary element tags. Use https://freecatphotoapp.com as the anchor’s href attribute value.

This is what I wrote:

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

This is the response:
You should only add one opening anchor (a) tag. Please remove any extras. Your img element should be nested within the anchor (a) element. The entire img element should be inside the opening and closing tags of the anchor (a) element.

What have I done wrong? I have been stuck on this line all day. Also, I am not sure what it means by “your img element”
I am very lost on how to go forward. Any help would be appreciated.

7 Likes

HI @ejfad !

Welcome to the forum!

The test wants you to nest the img element inside the anchor tags.
The opening anchor tag should go before the img element and the closing anchor tag should go at the end of the image element.
I would reset the lesson and try again.

Hope that helps!

9 Likes

I am confused about what nesting the img element even means. Do i have to add <img after the href link? Im sorry, I’m not really following what it is trying to ask.

4 Likes

The term nesting means to put one element inside the other.

Here is an example of nesting a p element inside a div element.

<div>
  <p>This is nesting</p>
</div>

You see how the opening div tag comes first,

<div>

then the p tag

<p>This is nesting</p>

then the closing div tag

</div>

The same concept applies to this challenge.

opening anchor tag goes here
img element goes here
closing anchor tag goes here

Hope that helps!

11 Likes

So it could be like:

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

Im just trying to make sure I’m following the example. So is the img element the entire line?

9 Likes

Yes, that is correct.

That is nesting.

You will doing that a lot with HTML :+1:

5 Likes

Thank You! You have been much help!

1 Like

thanks for helps very constructive

1 Like

A post was split to a new topic: Need help with step 14 of HTML cat photo app

Goodevening please I’m a beginner how do i get started everything looks strange to me i don’t know where to start from please help me what’s the name of what I’m doing thanks if there’s a WhatsApp group i will love to be added

try freecodecamp.org

2 Likes

i dont know of any but the freecodecamp forum is good

2 Likes

Well the nesting is correct
Bt they are saying to only add one opening anchor tag. Please remove any extras

Here is the link to your post. Check it out