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

Answer key

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

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