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

Answer key

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

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