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

Answer key

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

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