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

Answer key

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

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