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

Answer key

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

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