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

Answer key

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

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