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.

1 Like

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!

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

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!

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

4 Likes

Yes, that is correct.

That is nesting.

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

1 Like

Thank You! You have been much help!