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

Answer key

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

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