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

Answer key

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

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