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

Answer key

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

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