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

Answer key

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

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