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

Answer key

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

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