Learn HTML by Building a Cat Photo App - Step 15

Tell us what’s happening:

Describe your issue in detail here.
Please I just don’t seem to figure out how to turn an image into a link by surrounding it with necessary element tags.
plus my codes don’t seem to be highlighting in colors anymore.

Your code so far

target=href="https://freecatphotoapp.com A cute orange cat lying on its back.

<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</a> in our gallery.</p>

<!-- User Editable Region -->

    <a> target=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>

<!-- 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/122.0.0.0 Safari/537.36 Edg/122.0.0.0

Challenge Information:

Learn HTML by Building a Cat Photo App - Step 15

You appear to have created this post without editing the template. Please edit your post to Tell us what’s happening in your own words.
Learning to describe problems is hard, but it is an important part of learning how to code.
Also, the more you say, the more we can help!

Hello @Sparrow !
So far, you’re on the right track but you have to change a few things in your code.

  1. Placing attributes.
    Attributes are usually placed in the opening tag of an element. Your href attribute should be in the opening tag of the anchor element, here,

The target is also an attribute, but it’s not needed in this case, so you can get rid of it. In addition, the link

should be in quotation marks.

Thanks a lot @stephenmutheu
I will get to it now
Thank you

1 Like

I have done what you said and somehow sir the code still doesn’t run

Can you copy the src value as it is in the hint box and paste it into your code? As suggested, you may have deleted something. If it still does not work, post your code here instead of a screenshot.

I copied the src value, it didn’t still work out

<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.">

You got the wrong anchor element syntax. Let me structure a syntax for you.

<a href="link"></a>

Now place your image tag in between the anchor tags.

2 Likes

Thank you sir, the code works now, im glad

You are very welcome!
Happy coding.

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