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

Answer key

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

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