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

Answer key

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

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