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

Answer key

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

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