Test your skills: HTML images

The aim of this skill test is to assess whether you understand images and how to embed them in HTML.

Note: You can try solutions in the interactive editors on this page or in an online editor such as CodePen, JSFiddle, or Glitch.

If you get stuck, you can reach out to us in one of our communication channels.

Task 1

In this task, we want you to embed a simple image of some Blueberries into the page. You need to:

  • 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 in a folder inside the current folder called images.
  • Add some alternative text to an appropriate attribute to describe the image, for people that cannot see it.
  • Give the <img> element an appropriate width and height 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.

Try updating the live code below to recreate the finished example:

Download the starting point for this task to work in your own editor or in an online editor.

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.

Try updating the live code below to recreate the finished example:

Download the starting point for this task to work in your own editor or in an online editor.

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.

Try updating the live code below to recreate the finished example:

Download the starting point for this task to work in your own editor or in an online editor.