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

Answer key

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

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