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

Answer key

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

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