← Images with img, src and alt lesson New set →

HTML Worksheet: Images and Alt Text

HTML and CSS lesson 7: Images with img, src and alt · Set 606 · 40 questions
TalentJR

Code tip (File and words): <img src="file.jpg" alt="what it shows" width="200"> — no closing tag. src = which file to load; alt = words describing it; width / height = size in pixels. If the picture fails, the browser shows the alt text; screen readers read it aloud.

NameDateTime takenScore ___ / 40
  1. 1.True or false: in <img>, height sets how tall it is. (a) False (b) True
  2. 2.True or false: in <img>, src names the picture file. (a) False (b) True
  3. 3.True or false: in <img>, alt describes the picture. (a) True (b) False
  4. 4.🖼️ Which picture file does the browser load?
    <img src="cake.jpg" alt="Birthday cake" width="200">
    (a) moon.png (b) Birthday cake (c) cake.jpg (d) dog.jpg
  5. 5.🖼️ The picture cannot load. Which text does the browser show instead?
    <img src="fort.jpg" alt="An old fort" width="150">
    (a) An old fort (b) width (c) fort.jpg (d) A tiger asleep
  6. 6.🖼️ Why do we add alt text to an image? (a) to describe the image (b) to load it faster (c) to colour it (d) to make it bigger
  7. 7.🖼️ Which attribute of <img> tells which image to load? (a) height (b) width (c) alt (d) src
  8. 8.True or false: in <img>, width is read by screen readers. (a) False (b) True
  9. 9.🖼️ Which picture file does the browser load?
    <img src="fort.jpg" alt="An old fort" width="300">
    (a) kite.png (b) An old fort (c) tiger.jpg (d) fort.jpg
  10. 10.🖼️ Does <img> need a closing tag? (a) No (b) Yes
  11. 11.🖼️ The picture cannot load. Which text does the browser show instead?
    <img src="tiger.jpg" alt="A tiger asleep" width="50">
    (a) width (b) tiger.jpg (c) A red kite (d) A tiger asleep
  12. 12.🖼️ Which picture file does the browser load?
    <img src="cake.jpg" alt="Birthday cake" width="50">
    (a) moon.png (b) dog.jpg (c) cake.jpg (d) Birthday cake
  13. 13.True or false: in <img>, alt sets how wide it is. (a) False (b) True
  14. 14.True or false: in <img>, src tells which image to load. (a) True (b) False
  15. 15.🖼️ The picture cannot load. Which text does the browser show instead?
    <img src="tiger.jpg" alt="A tiger asleep" width="350">
    (a) width (b) A red kite (c) tiger.jpg (d) A tiger asleep
  16. 16.True or false: in <img>, width describes the picture. (a) False (b) True
  17. 17.🖼️ Which attribute of <img> names the picture file? (a) height (b) alt (c) width (d) src
  18. 18.True or false: in <img>, src sets how wide it is. (a) False (b) True
  19. 19.True or false: in <img>, alt sets how tall it is. (a) False (b) True
  20. 20.🖼️ Which picture file does the browser load?
    <img src="tiger.jpg" alt="A tiger asleep" width="400">
    (a) A tiger asleep (b) kite.png (c) map.png (d) tiger.jpg
  21. 21.🖼️ Which attribute of <img> is read by screen readers? (a) alt (b) height (c) src (d) width
  22. 22.🖼️ Which attribute of <img> sets how wide it is? (a) src (b) alt (c) height (d) width
  23. 23.🖼️ The picture cannot load. Which text does the browser show instead?
    <img src="moon.png" alt="The full moon" width="150">
    (a) width (b) The full moon (c) Our school bus (d) moon.png
  24. 24.🖼️ How many pixels wide is the picture drawn?
    <img src="cake.jpg" alt="Birthday cake" width="250">
  25. 25.🖼️ Which picture file does the browser load?
    <img src="kite.png" alt="A red kite" width="200">
    (a) map.png (b) cake.jpg (c) A red kite (d) kite.png
  26. 26.🖼️ Which picture file does the browser load?
    <img src="moon.png" alt="The full moon" width="50">
    (a) The full moon (b) fort.jpg (c) moon.png (d) bus.jpg
  27. 27.🖼️ Which picture file does the browser load?
    <img src="kite.png" alt="A red kite" width="400">
    (a) A red kite (b) kite.png (c) cake.jpg (d) map.png
  28. 28.🖼️ Which picture file does the browser load?
    <img src="kite.png" alt="A red kite" width="350">
    (a) cake.jpg (b) map.png (c) A red kite (d) kite.png
  29. 29.🖼️ Which picture file does the browser load?
    <img src="dog.jpg" alt="A happy dog" width="100">
    (a) moon.png (b) A happy dog (c) dog.jpg (d) bus.jpg
  30. 30.🖼️ The picture cannot load. Which text does the browser show instead?
    <img src="bus.jpg" alt="Our school bus" width="200">
    (a) Our school bus (b) width (c) An old fort (d) bus.jpg
  31. 31.🖼️ The picture cannot load. Which text does the browser show instead?
    <img src="moon.png" alt="The full moon" width="400">
    (a) The full moon (b) width (c) moon.png (d) Our school bus
  32. 32.🖼️ Which picture file does the browser load?
    <img src="tiger.jpg" alt="A tiger asleep" width="300">
    (a) map.png (b) A tiger asleep (c) tiger.jpg (d) kite.png
  33. 33.🖼️ Which attribute of <img> describes the picture? (a) width (b) height (c) alt (d) src
  34. 34.🖼️ Which picture file does the browser load?
    <img src="tiger.jpg" alt="A tiger asleep" width="150">
    (a) A tiger asleep (b) map.png (c) kite.png (d) tiger.jpg
  35. 35.🖼️ How many pixels wide is the picture drawn?
    <img src="fort.jpg" alt="An old fort" width="300">
  36. 36.🖼️ The picture cannot load. Which text does the browser show instead?
    <img src="kite.png" alt="A red kite" width="50">
    (a) kite.png (b) width (c) A red kite (d) Map of India
  37. 37.🖼️ Which picture file does the browser load?
    <img src="kite.png" alt="A red kite" width="300">
    (a) A red kite (b) kite.png (c) map.png (d) cake.jpg
  38. 38.🖼️ How many pixels wide is the picture drawn?
    <img src="map.png" alt="Map of India" width="50">
  39. 39.🖼️ How many pixels wide is the picture drawn?
    <img src="bus.jpg" alt="Our school bus" width="400">
  40. 40.🖼️ How many pixels wide is the picture drawn?
    <img src="map.png" alt="Map of India" width="150">

Answer key

  1. True
  2. True
  3. True
  4. cake.jpg
  5. An old fort
  6. to describe the image
  7. src
  8. False
  9. fort.jpg
  10. No
  11. A tiger asleep
  12. cake.jpg
  13. False
  14. True
  15. A tiger asleep
  16. False
  17. src
  18. False
  19. False
  20. tiger.jpg
  21. alt
  22. width
  23. The full moon
  24. 250
  25. kite.png
  26. moon.png
  27. kite.png
  28. kite.png
  29. dog.jpg
  30. Our school bus
  31. The full moon
  32. tiger.jpg
  33. alt
  34. tiger.jpg
  35. 300
  36. A red kite
  37. kite.png
  38. 50
  39. 400
  40. 150

Free html and css lessons, practice and worksheets at talentjr.in/html-css-for-kids