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

Answer key

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

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