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

Answer key

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

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