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

Answer key

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

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