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

Answer key

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

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