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

Answer key

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

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