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

Answer key

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

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