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

Answer key

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

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