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

Answer key

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

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