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

Answer key

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

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