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

Answer key

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

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