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

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