I am wrinting this code exacly like they ask but still it says it’s wrong. Can someone please help me?
Here is my code:
<a href="https://freecatphotoapp.com">
<img src="https://cdn.freecodecamp.org/curriculum/cat-photo-app/relaxing-cat.jpg" alt="A photo of a cat.">
</a>
Reponse:
Your anchor (a ) element should have an opening tag. Opening tags have this syntax: <elementName> .
Your code so far
<html>
<body>
<main>
<h1>CatPhotoApp</h1>
<h2>Cat Photos</h2>
<!-- TODO: Add link to cat photos -->
<a href="https://freecatphotoapp.com">
<img src="https://cdn.freecodecamp.org/curriculum/cat-photo-app/relaxing-cat.jpg" alt="A photo of a cat.">
</a>
<!-- 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/124.0.0.0 Safari/537.36
You seem to have inadvertantly deleted some of the code that is needed for this project.
You should click the reset button to restore the original code than add the anchor tag as requested.
as the instructions are asking you to use an anhor tag to make the img into a link, then the anchor’s opening tag must go to the left of the img and the closing tag to its right.
hopefully you have reset the code so you can restore the lost code first.
Please post your new code in your response so we can comment on it.
Make sure to write three backticks above and below the code so it is reviewable on this forum. Like this:
```
code here
```
I’ve edited your code 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.