Tell us what’s happening:
Describe your issue in detail here.
Your code so far
<html>
<body>
<main>
<h1>CatPhotoApp</h1>
<h2>Cat Photos</h2>
<!-- TODO: Add link to cat photos -->
<p> see more <a target="_blank" href="https://freecatphotoapp.com">cat photos <img src="https://cdn.freecodecamp.org/curriculum/cat-photo-app/relaxing-cat.jpg" alt="A cute orange cat lying on its back"></a> in our gallery</p>
<!-- User Editable Region -->
<!-- User Editable Region -->
</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/112.0.0.0 Safari/537.36 Edg/112.0.1722.68
Challenge: Learn HTML by Building a Cat Photo App - Step 15
Yes, I am confused as to why it still say your anchor should have an opening tag and will not let me progress to the next step. My code has an opening tag <a, and my img element is inside my anchor element. It seems like everything is rights and the way it should be, dont know why it still is not working.
Oh I see what you’ve done. You’ve altered the code from a previous step.
Firstly, you’re best off resetting this step altogether so you have the correct starting code for this step.
To turn an image into a link, all you need to do is enclose it within a pair of anchor tags. So put an opening anchor tag in front of the img element and a closing anchor tag at the end of it. Then add the required href attribute to the opening anchor tag.
Don’t modify the p element above it, or any other code on the page.
ohh ok I see the mistake I made by altering code, however I did what you said to do, I reset my code and did not alter the p element and put the img element in the anchor tag properly with the proper href attribute, but now it still is wrong and say “you should only add one opening anchor (a ) tag. Please remove any extras”.
Copy the whole HTML and then click on the </> icon (Preformatted Text tool) or CTRL+e. You can then paste the code between the two sets of triple backticks.
Great, thanks.
You’ve got it now - the only tiny error is in your closing anchor tag.
Just check the syntax - compare it with other closing tags and you’ll see what’s different.