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

Answer key

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

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