I am trying to nest anchor to new paragraph..but the result is happening

Tell us what’s happening:

Your code so far


<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>
<p>
<a href="view more cat photos">cat photos</a>
View more
</p>...
</main>

Your browser information:

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

Challenge: Nest an Anchor Element within a Paragraph

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

A couple of things:

You should be using the same anchor tag, just with different anchor text. So you can just copy and paste what is in the anchor tag.

href="http://freecatphotoapp.com"

note that :point_up: href should equal a URL not the text you want to be shown.

The text between the opening and closing anchor tags is what will be the linked text. So if you just copy and paste <a href="http://freecatphotoapp.com" target="_blank">"View more "</a> the text that will be displayed is ‘View more’

Make sure to read all of the instructions so you know where to place the anchor tag, as well as what to have as anchor text.

1 Like

but still it doesn’t work…

Show us what you have so far. Post example.

So what you have shown us so far is this:

<p>
<a href="view more cat photos">cat photos</a>
View more
</p>
</main>

The challenge says

Now nest the existing a element within a new p element (just after the existing main element). The new paragraph should have text that says “View more cat photos”, where “cat photos” is a link, and the rest of the text is plain text.

So you need to move the p element outside of the existing main element. That could be another thing that is tripping you up.

You’ve got the correct text in between the opening and closing a tags, but the href attribute is wrong, and the target attribute is missing.

You’re close. Just a couple corrections and you’ve got it!

i was doing same thing but invain…

can you post what you’ve got and I’ll let you know where you’re still a little off?

the tests are expecting you to change this anchor element not to create a new one, if you create a new one even if in the right way tests will fail

That’s not true, this code passes the test, and it has two anchor tags.

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

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

ok, you are right, but still:

Now nest the existing a element within a new p element (just after the existing main element). The new paragraph should have text that says “View more cat photos”, where “cat photos” is a link, and the rest of the text is plain text.

You have not followed instructions

Yeah, I agree it’s not what the challenge specified. I think he just has the code in the wrong spot is all.