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

Answer key

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

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