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

Answer key

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

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