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

Answer key

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

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