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

Answer key

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

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