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

Answer key

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

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