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

Answer key

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

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