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

Answer key

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

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