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

Answer key

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

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