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

Answer key

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

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