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

Answer key

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

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