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

Answer key

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

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