Tell us what’s happening:
Hello again, the hint suggests my code should only contain one anchor (a) element, & that I need to remove any extra anchor elements. But I’m not sure as to what that means, maybe I missed something?
**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 href="https://freecatphotoapp.com">cat photos</p>
<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/104.0.0.0 Safari/537.36
Challenge: Learn HTML by Building a Cat Photo App - Step 12
Link to the challenge:
You never close this anchor element with a </a>
tag, which is causing issues that are confusing the tests.
1 Like
I’ve fixed this mistake. The hint further suggests the only p
element content visible in the browser should be Click here to view more cat photos.
which I think I’ve done , my code still fails.
You have the text ‘cat photos’ twice
1 Like
I’ve fixed this mistake, the hint remains the same
What is your new code? You should not delete the anchor text.
I’ve edited your post for readability. When you enter a code block into a forum post, please precede it with a separate line of three backticks and follow it with a separate line of three backticks to make it easier to read.
You can also use the “preformatted text” tool in the editor (</>
) to add backticks around text.
See this post to find the backtick on your keyboard.
Note: Backticks (`) are not single quotes (').
1 Like
<p>click here to view more
<a href="https://freecatphotoapp.com">cat photos</a>
You deleted things you were not told to delete. In this case, you deleted the closing </p>
tag.
1 Like
I’ve fixed this mistake, the hint says my anchor (a
) element should be nested within the p
element, I’m not sure how to do that.
What is your updated code?
<p>click here to view more</p>
<a href="https://freecatphotoapp.com">cat photos</a>
Now your anchor element is no longer inside of the p
element. You must have the <a...
all the way through to /a>
INSIDE of the p
element, or nested between the opening and closing p
tags.
1 Like
I understand, I have done that but the hint says my anchor (a
) element should be nested within the p
element.
Where have you done that? The last code you have posted has your a
element outside of the p
element, not nested inside of the p
element.
Can’t you just show me how visually?
we cannot give you the answer we can only guide you or give you steps
Yup - we aren’t allowed to give out answers.
can you help explain it differently then please
your a element is not in the p element with out a closing p bracket
<p></p>
and then an a element inside the p
2 Likes