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

Answer key

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

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