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


#1


https://www.codecademy.com/courses/learn-html-css/lessons/common-elements/exercises/link-at-will?action=lesson_resume


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>
<html>
<head>
  <title>Animals Around the World</title>
</head>
<body>
  <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"/>
  </a>
  <p>The following are subspecies of bears:</p>
  <ul>
    <li>Arctos</li>
    <li>Collarus</li>
    <li>Horribilis</li>
    <li>Nelsoni (extinct)</li>
  </ul>
  <p>The following countries have the largest populations of brown bears:</p>
  <ol>
    <li>Russia</li>
    <li>United States</li>
    <li>Canada</li>
  </ol>
</body> 
</html>


#2

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?


#3

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:


#4

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