Wrapping the <img> element with an <a> element


#1

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

I’m getting an error saying “Did you wrap the image element with an anchor tag”.I can’t find the error.Could anyone say why I’m getting this and how I could move on to the next lesson.

I had tried what people suggested, it didn’t work. Please help me. I’ve been stucked for long time. >"<


<a href="https://en.wikipedia.org/wiki/Brown_bear" target="_blank">
<img src="#" alt="A brown bear" /></a>



#2

Try, by adding an extra-SPACE-character before self-closing the <img />-tag
like
<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>


#3

Thanks for your advice. But it still doesn’t work. I can’t figure out it.


#4

Could you provide the FULL HTML code you are using…


#5


#6

That is not the FULL code…!!!


#7

sorry to disturb. I’m not sure what the corrected thing.Could you plz for example.


#8

I wnat to see something like

<!DOCTYPE html>
  <html>
     <head>
          <title> </title>
     </head>
     <body>
       <!-- here you insert your HTML-code -->
     </body>
  </html>

but then with all your code…


#9


#10

Try to use the <a><img /></a> in a different position
like

<!DOCTYPE html>
<html>
<head>
  <title>Animals Around the World</title>
</head>
<body>
  <!-- anywhere -->
  <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>
 
  <p>The following are subspecies of bears:</p>
  <ul>
    <li>Arctos</li>
    <li>Collarus</li>
    <li>Horribilis</li>
    <li>Nelsoni</li>
  </ul>
  <ol>
    <li>Russia</li>
    <li>United States</li>
    <li>Canada</li>
  </ol>
  <p>populations</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 bear" /></a>
</body> 
</html>

#11

Is there any possibility that the system is error? >"<


#12

Then do the following
-1 make a copy of your code
-2 =click= on the -Reset- button (located on the right-hand-side of the RUN button)
-3 reset your Browser using the F5-keyboard-key
-4 if there is no code, paste-in the code you saved in point 1
-5 use the RUN button.


#13

Thank you so much. I tried, but It’s no use.


#16

hey man instead of moving the img code up to the link up top move the link code down to where you coded the image in.


#17
Animals Around the World

The Brown Bear

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.

Learn More

The following are subspecies of bears:

  • Arctos
  • Collarus
  • Horribilis
  • Nelsoni (extinct)

The following countries have the largest populations of brown bears:

  1. Russia
  2. United States
  3. Canada
A brown bear

#18

The test fails if you remove the other link instead of copying it.


#19

You must delete what you already have and start with this. A red prickly pear fruit Good Luck! Do you se what it just did? it gave me the end result. From the example given on the left screen, copy that and paste that right under where a brown bear ends. staying aligned with <img then run. It should work.


#20

try dis

<img src="https://s3.amazonaws.com/codecademy-content/courses/web-101/web101-image_brownbear.jpg" alt="A brown bear"

#21

I had a similar problem but solved it by adding a space between the end of the link to the Wikipedia site and the word target, as per: <img


#22

Sorry that did not come out as I wanted it. The space between <a href=“https://en.wikipedia.org/wiki/Brown_Bear” and the next word which is target="_blank"