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

Answer key

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

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