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

Answer key

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

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