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

Answer key

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

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