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

Answer key

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

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