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

Answer key

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

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