Turning the image into a link by surrounding it with necessary element tags

Tell us what’s happening:
Describe your issue in detail here.

Step 14

Turn the image into a link by surrounding it with necessary element tags. Use https://freecatphotoapp.com as the anchor’s hrefattribute value. How do I turn the image into a link?

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

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.5 Safari/605.1.15

Challenge: Step 14

Link to the challenge:

Hi,

So when you made the text ‘cat photos’ into a link you did it like this,

<p>Click here to view more <a target="_blank" href="https://freecatphotoapp.com">cat photos</a>.</p>

So, to make this work you need to write out the anchor element and put the img code where the text ‘cat photos’ was in the above example, you will turn the image into a link.

Here is an example of how this can be written. Apply this to your own code.

<a href=“example.com”><img src=“example.jpg” alt=“example image”></a>

Hope that helps!

4 Likes