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

Answer key

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

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