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

Answer key

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

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