Nest an Anchor Element within a Paragraph please help...what is the link

Tell us what’s happening:
Error: Your a element should be nested within your new p element.

Your code so far


<h2>CatPhotoApp</h2>
<main>

<p>View more
  <a href="" target="_blank">cat photos</a>
</p>

  <a href="http://freecatphotoapp.com" target="_blank">cat photos</a>
  
  <img src="https://bit.ly/fcc-relaxing-cat" alt="A cute orange cat lying on its back.">
  
  <p>Kitty ipsum dolor sit amet, shed everywhere shed everywhere stretching attack your ankles chase the red dot, hairball run catnip eat the grass sniff.</p>
  <p>Purr jump eat the grass rip the couch scratched sunbathe, shed everywhere rip the couch sleep in the sink fluffy fur catnip scratched.</p>


</main>

Your browser information:

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

Link to the challenge:
https://learn.freecodecamp.org/responsive-web-design/basic-html-and-html5/nest-an-anchor-element-within-a-paragraph/

Hi there @Chinmaya.

You already have the correct link http://freecatphotoapp.com however, the order/placement of your code is incorrect, and one of your <a> tags is redundant.

Here is the result from your code:
test

Notice how you have only failed one of the tests, specifically having the a element nested within the p element. If you are unfamiliar with nesting, it just means to have an element be contained inside another

example

<p> <a href="#">Cat Photos</a> </p>

.....................................

<p>
   <a href="#">Cat Photos</a>
</p>

Both the above are examples of a ‘nested’ element (in this case, the a tag.) This breakdown with the information that one of your a elements is redundant (not needed,) should be sufficient in breaking down the problem, if you are still stuck feel free to @ me!

2 Likes

@Kyle-S-Thompson I am still facing the problem…The code camp is not letting me attach screenshots please help.

CODE1
<h2>CatPhotoApp</h2>

<main>

<p>View more<a href=“cat photos” target="_blank">cat photos</a></p>

<a href=“http://freecatphotoapp.com” target="_blank">cat photos</a>

<img src=“https://bit.ly/fcc-relaxing-cat” alt=“A cute orange cat lying on its back.”>

<p>Kitty ipsum dolor sit amet, shed everywhere shed everywhere stretching attack your ankles chase the red dot, hairball run catnip eat the grass sniff.</p>

<p>Purr jump eat the grass rip the couch scratched sunbathe, shed everywhere rip the couch sleep in the sink fluffy fur catnip scratched.</p>

</main>

CODE2
<h2>CatPhotoApp</h2>

<main>

<p>View more

<a href=“cat photos” target="_blank">cat photos</a>

</p>

<a href="#" target="_blank">cat photos</a>

<img src="#" alt=“A cute orange cat lying on its back.”>

<p>Kitty ipsum dolor sit amet, shed everywhere shed everywhere stretching attack your ankles chase the red dot, hairball run catnip eat the grass sniff.</p>

<p>Purr jump eat the grass rip the couch scratched sunbathe, shed everywhere rip the couch sleep in the sink fluffy fur catnip scratched.</p>

</main>

IT IS STILL NOT WORKING

1 Like

@Chinmaya I try to avoid posting direct solutions, but since you are still stuck: Here is the correct code…

<h2>CatPhotoApp</h2>
<main>

<p>View more
  <a href="http://freecatphotoapp.com" target="_blank">cat photos</a>
</p>
  
  <img src="https://bit.ly/fcc-relaxing-cat" alt="A cute orange cat lying on its back.">
  
  <p>Kitty ipsum dolor sit amet, shed everywhere shed everywhere stretching attack your ankles chase the red dot, hairball run catnip eat the grass sniff.</p>
  <p>Purr jump eat the grass rip the couch scratched sunbathe, shed everywhere rip the couch sleep in the sink fluffy fur catnip scratched.</p>
</main>

Here is also the starting code when you first load the challenge without making any changes…

<h2>CatPhotoApp</h2>
<main>
  
  <a href="http://freecatphotoapp.com" target="_blank">cat photos</a>
  
  <img src="https://bit.ly/fcc-relaxing-cat" alt="A cute orange cat lying on its back.">
  
  <p>Kitty ipsum dolor sit amet, shed everywhere shed everywhere stretching attack your ankles chase the red dot, hairball run catnip eat the grass sniff.</p>
  <p>Purr jump eat the grass rip the couch scratched sunbathe, shed everywhere rip the couch sleep in the sink fluffy fur catnip scratched.</p>
</main>

All the task is asking you to do, is nest the a element inside of a p element that has the text 'View more.'

BEFORE…

  <a href="http://freecatphotoapp.com" target="_blank">cat photos</a>

AFTER…

  <p>View more
  <a href="http://freecatphotoapp.com" target="_blank">cat photos</a>
  </p>

OR…

  <p>View more <a href="http://freecatphotoapp.com" target="_blank">cat photos</a>
  </p>

I hope this helps clear up any confusion!

1 Like

@Kyle-S-Thompson
<h2>CatPhotoApp</h2>

<main>

<p>View more

<a href="#" target="_blank"> cat photos</a>

</p>

<img src="#" alt=“A cute orange cat lying on its back.”>

<p>Kitty ipsum dolor sit amet, shed everywhere shed everywhere stretching attack your ankles chase the red dot, hairball run catnip eat the grass sniff.</p>

<p>Purr jump eat the grass rip the couch scratched sunbathe, shed everywhere rip the couch sleep in the sink fluffy fur catnip scratched.</p>

</main>

What is the difference between your and mine code?..I am not able to understand the problem…But when I copy paste yours it works but when I edit mine it does not…

@Chinmaya your a and img elements still need a link included for the href and src respectively, as oppose to just a #

Your a and img elements…

<a href="#" target="_blank"> cat photos</a>

<img src="#" alt="A cute orange cat lying on its back.">

The a and img elements when you load the challenge…

<a href="http://freecatphotoapp.com" target="_blank">cat photos</a>

<img src="https://bit.ly/fcc-relaxing-cat" alt="A cute orange cat lying on its back.">

Notice how the href and src attributes have links specified?

If you don’t include the links, the test will give you the following feedback…
test

Once again, if you are still unsure, don’t hesitate to @ me

1 Like

thank you @Kyle-S-Thompson you have been a great help.

1 Like

No problem at all :slight_smile: