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

Answer key

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

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