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

Answer key

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

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