Learn HTML by Building a Cat Photo App - Step 15

Tell us what’s happening:
Describe your issue in detail here.
Hi , I’m stuck on the part about turning the img into a link. Please help.

Your code so far

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

   <elementName> <img src="https://cdn.freecodecamp.org/curriculum/cat-photo-app/relaxing-cat.jpg" alt="A cute orange cat lying on its back.">

<!-- User Editable Region -->


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

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

Link to the challenge:

To make something a link, you have to wrap it in anchor tags. It works on text, like you did before, just like it would work on an image. If you put the image between anchor tags it becomes a clickable link, and will go to whatever address you put in the href attribute.

If you want an example about what an anchor tag might look like, there is one right above the code you are currently working on.

Let us know if that helps :slight_smile:

Hey. Firstly, thanks for responding :grinning:. I get create a code for an image and the hyperlinks separately. I just don’t know how to combine the 2.

What I understand so far is:
Creating an image link using the img src element.
Creating a hyperlink using the a href element.

I just don’t know how to combine the 2. Do I erase the img src and insert the image link directly into the a href tag?

Well, just like you did with the text above it.

<open hyperlink anchor tag>

    <Whatever you want to be clickable> 

</close hyperlink anchor tag>

Does that help?

Hey. Update: I’ve resolved the problem.

Thank you!

1 Like

It worked. Thank you so much!!!

1 Like

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