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

Answer key

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

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