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

Answer key

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

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