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

Answer key

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

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