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

Answer key

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

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