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

Answer key

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

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