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

Answer key

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

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