Images as Links
You have surely come across an image that is also a link. On YouTube, for example, clicking a video's picture takes you to the page with that video. Let's see how to do that.
<a href="address">
<img src="image-address" alt="Image description">
</a>It's simple: we put the image inside the a element, so that it becomes a child of the link. Clicking the image then works just like clicking the text of a link.
We can turn other HTML elements into links the same way: we just put them inside an a element.
Instructions
- 1
Wrap the cat image in a new link: right before the
imgelement, write the opening tag<a href="https://en.wikipedia.org/wiki/Cat">, and right after it, the closing tag</a>. - 2
Add the
targetattribute with the value_blankto this new link, so that it opens in a new tab.