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

Answer key

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

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