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

Answer key

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

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