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

Answer key

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

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