Learn HTML by Building a Cat Photo App - Step 15

Tell us what’s happening:
Describe your issue in detail here.
Can’t figure out how to do step 15

Your code so far

<html>
  <body>
    <main>
      <h1>CatPhotoApp</h1>
      <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>
    <a target= href="https://freecatphotoapp.com"></a> <img src="https://cdn.freecodecamp.org/curriculum/cat-photo-app/relaxing-cat.jpg" alt="A cute orange cat lying on its back.">

Your browser information:

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

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

Link to the challenge:

<html>
  <body>
    <main>
      <h1>CatPhotoApp</h1>
      <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>
    <a target="_blank" href="https://freecatphotoapp.com"><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>

Still not right? It’s telling me theres more than one anchor tag. Where is there more than one?

you weren’t asked for a target attribute, so you should not be including it in the new code.
And you still need a closing anchor tag at the right side of the img

If its wrong, then why is the picture as a link working?

<html>
  <body>
    <main>
      <h1>CatPhotoApp</h1>
      <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>
    <a> href="https://freecatphotoapp.com"><img src="https://cdn.freecodecamp.org/curriculum/cat-photo-app/relaxing-cat.jpg"</a> alt="A cute orange cat lying on its back.">
    </main>
  </body>
</html>

Now it doesn’t work

you have a > bracket in the middle which doesn’t belong there
rewrite it so that the tag has a < at the start and a > at the end (no brackets in the middle)

and you still need a closing tag to the right of the img element (you have it in the middle of the img element. You need to move it all the way to the right so it is the last thing on that line)

A bracket is a > character? Or a < ? Either?
so

<a href="https://freecatphotoapp.com"> 

?
I

What you have now is a good opening anchor tag.

So the correct code is

<html>
  <body>
    <main>
      <h1>CatPhotoApp</h1>
      <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>
    <a href="https://freecatphotoapp.com"><img src="https://cdn.freecodecamp.org/curriculum/cat-photo-app/relaxing-cat.jpg" alt="A cute orange cat lying on its back."> </a>
    </main>
  </body>
</html>

but I don’t understand why

Not sure I understand the question?

Perhaps you can reread step 10 and step 11 as they introduce anchor elements there.

What is this bracket for after <a href="https://freecatphotoapp.com"
Is <a href="https://freecatphotoapp.com"> ALL the opening anchor tag?

All HTML elements have a syntax.
The syntax is that they must start with a < left angled bracket and end with a > right angled bracket.

That is how they are properly formed.

Does this answer the question?

maybe, I thought the opening tag had to just be <a or <a> by itself, looks like it is suppose to contain other things before the closing bracket?

A properly formed tag always starts with < and ends with >

As for what is inside it, that depends on the tag.

For eg, an anchor tag is the keyword “a” but it is meaningless without the href attribute next to it. As the href tells the browser what to do when someone actually clicks the tag. (Where to go online…)

There are many elements and many tags.

Img elements are for displaying images. They need src attributes to be complete.

Paragraphs are p elements.

And many many many more that you will learn.

The one thing that doesn’t change though.

All element tags start and and end with the angled brackets.

1 Like