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

Answer key

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

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