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

Answer key

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

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