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

Answer key

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

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