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

Answer key

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

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