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

Answer key

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

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