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

Answer key

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

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