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

Answer key

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

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