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

Answer key

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

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