Nest Anchor Element within Paragraph

Nest Anchor Element within Paragraph
0

#1

Tell us what’s happening:

Don’t know what is happening. Says my a element does have “view more” element in it. View specific code here:

<p><a
    href="http://freecatphotoapp.com" </a></p>

  <p>target="_blank"> view more cat photos </p>

Your code so far


<h2>CatPhotoApp</h2>
<main>
  
  <p><a
    href="http://freecatphotoapp.com" </a></p>

  <p>target="_blank"> view more cat photos </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>

Your browser information:

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_3) AppleWebKit/604.5.6 (KHTML, like Gecko) Version/11.0.3 Safari/604.5.6.

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


Nest Anchor Element within a Paragraph
#2

Have a re-read of the task carefully and look at where your link is placed.


#3

You are missing a closing > on the opening anchor tag and for some reason you added another p element. You only should have one set of <p> and </p>


#4

Tell us what’s happening: Current code

<a href="http://freecatphotoapp.com"

target="_blank">view cat photos


What should I do? I’ve tried changing target="_blank">view cat photos which leaves me with

Your code so far


<h2>CatPhotoApp</h2>
<main>
  
 <p><a href="http://freecatphotoapp.com" </a>

target="_blank">view cat photos </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>

Your browser information:

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_3) AppleWebKit/604.5.6 (KHTML, like Gecko) Version/11.0.3 Safari/604.5.6.

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


#5

your statement is not valid.
Here’s how you write an anchor tag

<a href="mylink" target="_blank">LinkText</a>

#6

Thanks. Still doesn’t solve the problem:

Your a element should not have the text “View more”. My a element doesn’t appear to, at least, have that problem. But what should I do to correct code.


#7

please update your code above to the latest one you are using


#8

Hi, sorry, and thanks. If you’re interested in providing help {along with critique} please do so.
Other wise you can leave off commenting on my post. thanks again


#9

You incorrectly copy pasted my text, which was: What should I do? I’ve tried changing target="_blank">view cat photos


#10

What have you got so far?


#11

excerpt of text that is relevant.

 <p><a
    href="http://freecatphotoapp.com" </a></p>

  <p>target="_blank"> view more cat photos </p>

Everything is correct except I don’t understand how to make the a element not have “view more cat photos”. Feel free to ask more qs


#12

That’s ok I would rather walk you through it so you learn rather than just give you the answer like others


#13

I’ve edited your post for readability. When you enter a code block into the forum, precede it with a line of three backticks and follow it with a line of three backticks to make easier to read. See this post to find the backtick on your keyboard. The “preformatted text” tool in the editor (</>) will also add backticks around text.


#14

So the task is to
“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.”

Do you understand the bold bit?


#15

Let me explain what you have currently in your latest posted code.

You have two p elements when you should only have one p element.

The first p element has <a href="http://freecatphotoapp.com" </a> in it.

The second p element has p>target="_blank"> view more cat photos </p>

You were supposed to take the existing anchor element (seen below) and nest it into a single p element. That is all you have to do. You should not modify the anchor element in any way.

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

A refresher on how to nest an element. Below is an example of how to nest an h1 element in a div element.

<div>
  <h1>My h1 element</h1>
</div>

#16

So I revised to:

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

but it still says the a element has “view more”. I just have no idea what to do as i’ve tried so many combos already.


#17

As I said in my previous reply, you should not be changing the anchor tag at all.

The original anchor tag is:

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

and you have now changed it to:

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

You should only have one opening anchor tag and one closing anchor tag. My last reply showed you exactly how to nest one element within another element (see below):

<div>
  <h1>My h1 element</h1>
</div>

Replace the div element above with a p element and replace the h1 element above with the exact original anchor element in the challenge. That is all you have to do.


#18

Thank you! I just have. Not sure what else to do so it allows me to pass the tests.


#19

Can you post your code again if you are still not passing the tests?


#20

Thanks, I definitely can. Here we go!:

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

still says the p element needs “View more” as text.