Tell us what’s happening:
In step 14 of HTML it says
Turn the existing text (cute cats) into an anchor element that links to:
but I don’t know what to do I have tried my best. If you guys can help me.
Your code so far
<html>
<body>
<main>
<h1>CatPhotoApp</h1>
<h2>Cat Photos</h2>
<!-- TODO: Add link to cat photos -->
<!-- User Editable Region -->
<p>Everyone loves cute cats online! <a href="https://cdn.freecodecamp.org/curriculum/cat-photo-app/running-cats.jpg" alt="cute cats"</a></p>
<!-- User Editable Region -->
<p>See more <a href="https://freecatphotoapp.com">cat photos</a> in our gallery.</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/131.0.0.0 Safari/537.36
Challenge Information:
Build a Cat Photo App - Step 14
Hi. You need to wrap the anchor element tags around the existing text of “cute cats”. It doesn’t say to add an alt attribute. You haven’t put the closing tag on your opening anchor element.
I suggest you reset the step and try again.
1 Like
When you put the code: <a href="https://cdn.freecodecamp.org/curriculum/cat-photo-app/running-cats.jpg" alt="cute cats"</a>
What you’re doing is saying that everything that is between the <a>
and the </a>
is the anchor text (which means that when you click on it, it takes you to whatever you’re linked to. In your code, there is nothing between the two elements, so there is nothing to click on.
Also, it looks like you put an alt in there as well, which is good coding instinct and would be a good thing to do if you’re writing your own project. But you were not specifically told to do that in this step. And when it’s judging whether your code passes, it doesn’t really have an understanding of what you’re doing. It’s just designed to see if you specifically did what was asked. Anything extra, it’s going to interpret that as incorrect even if the code is good.
Also, just to nitpick but you didn’t close off the first part of your anchor element. You need to put a >
to end the first element.
1 Like