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

Answer key

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

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