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

Answer key

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

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