HTML: create a link to an image

**Hey guys! I am stuck in my practicing. The system says " Your anchor ( a ) element should have an opening tag. Opening tags have this syntax: <elementName> ."

Anyone could help me out? Thanks**

My code:

    <h2>Cat Photos</h2>
    <!-- TODO: Add link to cat photos -->
    <p><img src="" alt="A cute orange cat lying on its back."> <a href="" target="_blank" > 

**Challenge: Step 14**

**Link to the challenge:**


Firstly, you don’t need to move code in these lessons outside of the highlighted box. I’ve noticed you have put the anchor and paragraph ending tags after the main tag—this is incorrect and I advise you restart the lesson.

Secondly, you haven’t formatted this correctly. It wants you to wrap the link around the image. Think back to how you put the text inside the link in step 12, and how this made the text into a link.

<a href=“”> text</a>

You need to do the same thing, but instead of text, put the image element.

1 Like


There is a small thing to change: first you open a new anchor tag, then after the tag goes the link to the image, finally you close the anchor tag. Right now the image goes first, then the anchor tag is opened - the image has to be between to become clickable and lead somewhere.

1 Like

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