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

Answer key

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

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