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

Answer key

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

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