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

Answer key

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

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