10: Linking at will- not registering anchor tag wrap around image


<Below this line, add a link to the EXACT exercise that you are stuck at.>

<Below this line, in what way does your code behave incorrectly? Include ALL error messages.>
I’m getting the following error messege, but the code is functional.
Error:"Did you wrap the image element with an anchor tag?"

In the browser tab the image does link the wikipedia page. I can’t tell what’s wrong with how I’m wrapping the image with the anchor tag.

I’ve copy-pasted the code from the answer in this post and still get the same error.

I get the same result in Chrome, Firefox, and Safari.
Here is the img link code with anchor tag:

<!DOCTYPE html>
  <title>Animals Around the World</title>
  <h1>The Brown Bear</h1>
  <p>The brown bear (Ursus arctos) is native to parts of northern Eurasia and North America. Its conservation status is currently "Least Concern." There are many subspecies within the brown bear species, including the Atlas bear and the Himalayan brown bear.</p>
  <a href="https://en.wikipedia.org/wiki/Brown_bear" target="_blank">
    <img src="https://s3.amazonaws.com/codecademy-content/courses/web-101/web101-image_brownbear.jpg" alt="A 
    brown bear"/>
  <p>The following are subspecies of bears:</p>
    <li>Nelsoni (extinct)</li>
  <p>The following countries have the largest populations of brown bears:</p>
    <li>United States</li>

This is a glitch, and your code is correct. However,

The answer you copy-pasted is correct to solve this, your code should look like this:

<a href="https://en.wikipedia.org/wiki/Brown_bear" target="_blank"><img src="https://s3.amazonaws.com/codecademy-content/courses/web-101/web101-image_brownbear.jpg" alt="A brown bear" /></a>

Try resetting the exercise and paste that code?

1 Like

Copy-pasting your line still gives the same error. After enough clicks of the Run button I was prompted for the solution code. Still running the given solution code gives the same error. :rofl:

It looks like the code checker might be expecting the image at the bottom of the content not the middle.

I’m just glad I can move on to the next lesson. I really wish there was an option to skip lessons more easily, like other platforms allow, dataquest.io, udacity, etc.

Thanks for the help ghost. :smile:


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