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

Answer key

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

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