[HTML] How do you link images?

The example provided for HTML doesn’t work with what I post for the brown bear. I tried to copy exactly what was shown in the example but with the link asked and I can’t get the image to hyperlink.

Please post a link to the exercise, and show us the code you have written for it. Thanks.

Link wrapping an image, example…

<a href="#" title="Brown Bear" target="_blank">
  <img src="brownbear.jpg" width="200" height="200" alt="brown bear">
</a>

It can all be written on one line. I wrote it on three so it is easy to read.

1 Like

HTML lesson 12 Linking at will and lesson 13 New page

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

https://www.codecademy.com/courses/learn-html-elements/lessons/common-html-elements/exercises/linking-new-page-html?action=lesson_resume&course_redirect=learn-html

1 Like

@mtf the code you posted showed the hyperlink but not the image. the image disappeared.

That code was meant as an example, not the solution code.

<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" /></a>

Be sure there is a space before each attribute.

1 Like

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