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

Answer key

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

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