Test your skills: HTML images

This aim of this skill test is to assess whether you've understood our Images in HTML article.

Note: You can try out solutions in the interactive editors below, however it may be helpful to download the code and use an online tool such as CodePen, jsFiddle, or Glitch to work on the tasks.

If you get stuck, then ask us for help β€” see the Assessment or further help section at the bottom of this page.

HTML images 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.

HTML images 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.

HTML images 3

In this final 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.

Assessment or further help

You can practice these examples in the Interactive Editors above.

If you would like your work assessed, or are stuck and want to ask for help:

  1. Put your work into an online shareable editor such as CodePen, jsFiddle, or Glitch. You can write the code yourself, or use the starting point files linked to in the above sections.
  2. Write a post asking for assessment and/or help at the MDN Discourse forum Learning category. Your post should include:
    • A descriptive title such as "Assessment wanted for HTML image basics 1 skill test".
    • Details of what you have already tried, and what you would like us to do, e.g. if you are stuck and need help, or want an assessment.
    • A link to the example you want assessed or need help with, in an online shareable editor (as mentioned in step 1 above). This is a good practice to get into β€” it's very hard to help someone with a coding problem if you can't see their code.
    • A link to the actual task or assessment page, so we can find the question you want help with.