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

Answer key

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

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