Can someone point me in the right direction on Step 12?

Tell us what’s happening:
Describe your issue in detail here.

Step 12

Turn the words cat photos located inside p element into a link using the same value for the href attribute as the link below the p element. The p element should show the same text in the browser, but the words cat photos should now be a link. Make sure to remove the a element with the text cat photos on the line below the p element.

I got the “cat photos” in line 7 to become a link. The next step is where I am having trouble. It says to remove the “a” element but when I was messing with the a elements on line 8, I could not get rid of either “<a href” or “” without it looking off in the preview.

I am very new to coding and know little to nothing about this and have been stuck on this step for 2 days now. Any help would be appreciated!

  **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 <a href="cat photos"</p>
    <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 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.5005.61 Safari/537.36

Challenge: Step 12

Link to the challenge:

    <p>Click here to view more <a href="cat photos"</p>
    <a href="https://freecatphotoapp.com">cat photos</a>

On the first line you have half of an incorrect anchor:

<a href="cat photos"

On the second line, you have a good, correct anchor, but it needs to be where the first one is, inside the p.

Okay, so I got to this. I see in the preview that it looked better formatted than before. The instructions say I should only have 1 anchor (a) element so I am assuming I should only have the (a) anchor in line 7 because that is where the link is needed. So in line 8 do I have to remove my (a) anchor? If so, how do I go about it? Every time I remove it, it messes up the hyperlink?

Yes.

So in line 8 do I have to remove my (a) anchor?

No. As I said, the first one is not a properly formatted anchor.

Every time I remove it, it messes up the hyperlink?

Correct. Because line 8 is the only correctly formatted anchor you have. Actually, now that I look more close, it isn’t either, it’s missing the closing tag, (</a>) after the text.

It should have the format of:

<a src="some url">my text</a>

You want all of that inside the paragraph so its text flows with the other text.

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.