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

Answer key

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

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