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

Answer key

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

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