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

Answer key

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

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