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

Answer key

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

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