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

Answer key

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

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