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

Answer key

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

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