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

Answer key

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

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