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

Answer key

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

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