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

Answer key

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

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