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

Answer key

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

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