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

Answer key

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

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