Basic HTML and HTML5 - Turn an Image into a Link

Tell us what’s happening:

I reset the course and i tried everything but i couldn’t get rid of these items:

  1. The existing img element should be nested within an a element.
  2. Your a element should be a dead link with an href attribute set to #.

Your code so far

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

  <p>Click here to view more cat photos.</p>

  <p>Kitty ipsum dolor sit amet, shed everywhere shed everywhere stretching attack your ankles chase the red dot, hairball run catnip eat the grass sniff.</p>
  <p>Purr jump eat the grass rip the couch scratched sunbathe, shed everywhere rip the couch sleep in the sink fluffy fur catnip scratched.</p>
</main>

Your browser information:

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

Challenge Information:

Basic HTML and HTML5 - Turn an Image into a Link

it looks like you have the correct answer but the seed code that was given to you for this exercise was modified. You have erased at least one other element that needs to be there.

Click the reset button and add the anchor tag again (perhaps a bit more carefully to avoid unintended edits)

1 Like

Hi @nihaltasci73 and welcome to our community!

If you reset the lesson, just below your opening main tag you should have this code:

<p>Click here to view more <a href="#">cat photos</a>.</p>

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

You should enclose the img element in an anchor element, without modifying the p element above it.

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