Turn an Image into a Link

You can make elements into links by nesting them within an a element.

Nest your image within an a element. Here's an example:

<a href="#"><img src="https://cdn.freecodecamp.org/curriculum/cat-photo-app/relaxing-cat.jpg" alt="Three kittens running towards the camera."></a>

Remember to use # as your a element's href property in order to turn it into a dead link.


Place the existing image element within an a (anchor) element.

Once you've done this, hover over your image with your cursor. Your cursor's normal pointer should become the link clicking pointer. The photo is now a link.

Tests

  • Waiting: 1. The existing img element should be nested within an a element.
  • Waiting: 2. Your a element should be a dead link with an href attribute set to #.
  • Waiting: 3. Each of your a elements should have a closing tag.
/**
* Your test output will go here
*/