zhaki
May 19, 2022, 2:00pm
1
it keeps telling me that Your anchor ( a
) element should be nested within the p
element. and I’ve tried everything but it isn’t working
**Your code so far**
<html>
<body>
<h1>CatPhotoApp</h1>
<main>
<h2>Cat Photos</h2>
<!-- TODO: Add link to cat photos -->
<p>Click here to view more cat photos</a>
<a href="https://freecatphotoapp.com">cat photos</a>
<img src="https://cdn.freecodecamp.org/curriculum/cat-photo-app/relaxing-cat.jpg" alt="A cute orange cat lying on its back.">
</main>
</body>
</html>
**Your browser information:**
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/101.0.4951.41 Safari/537.36 Edg/101.0.1210.32
Challenge: Step 12
Link to the challenge:
The code you posted above looks like the default code for the step. What have you tried so far?
Here are the key parts of the instructions:
“replacing the words (cat photos) with the anchor element added previously.”
In other words, move the link below the <p>
into the <p>
by replacing the words “cat photos” with the actual link.
Hello there.
Do you have a question?
If so, please edit your post to include it in the Tell us what’s happening section.
Learning to describe problems is hard, but it is an important part of learning how to code.
Also, the more information you give us, the more likely we are to be able to help.
<p>Click here to view more cat photos</a>
Here you have two different elements for the start and end tags.
As said, you need to put the a
element inside the p
element. The a
element should replace the paragraph text cat photos
.
Example:
<h3>Go to <a href="#">top</a></h3>
1 Like
zhaki
May 19, 2022, 3:13pm
5
but then cat photos shows up in the browser and keeps telling me it shouldn’t be there
zhaki
May 19, 2022, 3:15pm
6
when I do this it tells me the links text should be cat photos
What is your updated code?
zhaki
May 19, 2022, 3:19pm
8
I don’t know ,what is that?
Just to be clear, the code I posted was just an example.
It would have started out like this:
<h3>Go to top</h3>
<a href="#">top</a>
And ended like this:
<h3>Go to <a href="#">top</a></h3>
Now look at the staring code again:
<p>Click here to view more cat photos.</p>
<a href="https://freecatphotoapp.com">cat photos</a>
1 Like
You said that you made changes to your code. What does your code look like now. Please post it.
1 Like
zhaki
May 19, 2022, 3:23pm
11
Thank you so much I just figured it out.
1 Like
what were u doing wrong, im stuck on same one
Looks like u forgot closing p tag
ILM
May 19, 2022, 8:14pm
14
if you create your own topic and post your own code I am sure you will receive help!
zhaki
May 20, 2022, 6:40am
15
replace the words cat photos in the p element with the anchor element
some times guys it doesn’t work even if you have everything right just restart the step from the restart step button and it’s gonna work
If it doesn’t work, you probably don’t “have everything right”. We sometimes have bugs, especially with the new curriculum, but it’s bad advice to assume that your code is correct when tests fail. Most of the forum posts have errors in the posted code.
The OP has already been helped, so I’m closing this topic.