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

Answer key

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

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