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

Answer key

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

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