Learn HTML by Building a Cat Photo App - Step 15

Tell us what’s happening:
I don’t understand why the syntax won’t work. Where am I supposed to put my anchor (a) opening and closing elements?

Your code so far

      <h2>Cat Photos</h2>
      <!-- TODO: Add link to cat photos -->
      <p>Click here to view more <a target="_blank" href="https://freecatphotoapp.com">cat photos</a>.</p>
      <img <a href="https://freecatphotoapp.com">src="https://cdn.freecodecamp.org/curriculum/cat-photo-app/relaxing-cat.jpg" alt="A cute orange cat lying on its back."</a>>

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/ Safari/537.36 Edg/108.0.1462.42

Challenge: Learn HTML by Building a Cat Photo App - Step 15

Link to the challenge:

Right now your code doesnt work because you are adding the anchor tag after the image, but it needs to come before the image

Example: <a href="link text"><img src="image source">

Thanks. On line 7, I can add the (a) tag between the <p> and </p>. Why is that? Or what’s the difference between <p> and (a)?

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.

See this post to find the backtick on your keyboard.
Note: Backticks (`) are not single quotes (').

P elements are used to tag text and the text within them can be nested in anchor elements.
img elements are self closing and so you cannot put another element inside them

1 Like

consider reading through this article from “mdn” it will help you understand bit more about what kinds of “html elements” are there, happy reading :slight_smile: HTML elements reference - HTML: HyperText Markup Language | MDN

1 Like

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