Test your skills: HTML images
The aim of this skill test is to help you assess whether you understand images and how to embed them in HTML.
Note: To get help, read our Test your skills usage guide. You can also reach out to us using one of our communication channels.
Task 1
In this task, we want you to embed an image of some Blueberries into the page.
To complete the task:
- Add the path to the image to an appropriate attribute to embed it on the page. The image is called
blueberries.jpg
, and it is available at a path ofhttps://github.com/mdn/learning-area/blob/main/html/multimedia-and-embedding/tasks/images/images/blueberries.jpg?raw=true
. - Add some alternative text to an appropriate attribute to describe the image, for people that cannot see it.
- Give the
<img>
element an appropriatewidth
so that it displays at the correct aspect ratio, and enough space is left on the page to display it. The image's intrinsic size is 615 x 419 pixels.
<h1>Basic image embed</h1>
<img />
Click here to show the solution
Your finished HTML should look like this:
<h1>Basic image embed</h1>
<img src="https://github.com/mdn/learning-area/blob/main/html/multimedia-and-embedding/tasks/images/images/blueberries.jpg?raw=true"
alt="A pile of small blue berries"
width="400" />
Task 2
In this task, you already have a full-featured image, but we'd like you to add a tooltip that appears when the image is moused over. You should put some appropriate information into the tooltip.
<h1>Basic image title</h1>
<img
src="https://github.com/mdn/learning-area/blob/main/html/multimedia-and-embedding/tasks/images/larch.jpg?raw=true"
alt="Several tall evergreen trees called larches" />
Click here to show the solution
Your finished HTML should look like this:
<h1>Basic image title</h1>
<img
src="https://github.com/mdn/learning-area/blob/main/html/multimedia-and-embedding/tasks/images/larch.jpg?raw=true"
alt="Several tall evergreen trees called larches"
title="And now, Number 1, The Larch" />
Task 3
In this task, you are provided with both a full-featured image and some caption text. What you need to do here is add elements that will associate the image with the caption.
<h1>Image and caption</h1>
<img
src="https://github.com/mdn/learning-area/blob/main/html/multimedia-and-embedding/tasks/images/firefox.png?raw=true"
alt="An abstract flaming fox wrapping around a blue sphere"
width="446"
height="460" />
The 2019 Firefox logo
Click here to show the solution
Your finished HTML should look like this:
<h1>Image and caption</h1>
<figure>
<img
src="https://github.com/mdn/learning-area/blob/main/html/multimedia-and-embedding/tasks/images/firefox.png?raw=true"
alt="An abstract flaming fox wrapping around a blue sphere"
width="446"
height="460" />
<figcaption>The 2019 Firefox logo</figcaption>
</figure>