Learn HTML by Building a Cat Photo App - Step 15

Tell us what’s happening:
Describe your issue in detail here.
Still stuck step 15. I’ve tried to put the anchor opening tag ( <a href=“”) in different places without success. I really don’t understand what am I supposed to do to turn the image into a link. TIA.

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>
      <a href="<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>

Your browser information:

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.0.0 Safari/537.36

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

Link to the challenge:

Change this to <a href="paste the given link over here">

thanks and sorry for being a pain. I just don’t know where to write it. Before the <img tag ? When I write that right like you told me it sais " its not possible to have 2 opening anchor tags. Sorry for being a pain, again.

To turn an image into a link, you can simply nest the whole img element (unaltered) inside a pair of anchor tags. Then you give the opening anchor tag an href attribute which points to the desired url.

Don’t add extra a tag just modify the one you have already created!

Hi,
Try to change the target attribute and define it after href attribute

<a target="_blank" href="https://freecatphotoapp.com">cat photos</a>.</p>

Placing the target on the left or right of the href makes no difference to this exercise or the validity of this code.

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