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

Answer key

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

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