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

Answer key

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

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