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

Answer key

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

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