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

Answer key

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

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