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

Answer key

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

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