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

Answer key

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

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