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

Answer key

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

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