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

Answer key

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

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