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

Answer key

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

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