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

Answer key

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

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