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

Answer key

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

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