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

Answer key

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

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