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

Answer key

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

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